From: Simon Montagu Rename nsFrame methods for bug 735577, try: -b do -p all -u all -t none diff --git a/accessible/src/base/StyleInfo.cpp b/accessible/src/base/StyleInfo.cpp --- a/accessible/src/base/StyleInfo.cpp +++ b/accessible/src/base/StyleInfo.cpp @@ -84,17 +84,17 @@ StyleInfo::TextIndent(nsAString& aValue) aValue.AppendLiteral("px"); } void StyleInfo::Margin(css::Side aSide, nsAString& aValue) { aValue.Truncate(); - nscoord coordVal = mElement->GetPrimaryFrame()->GetUsedMargin().Side(aSide); + nscoord coordVal = mElement->GetPrimaryFrame()->GetUsedPhysicalMargin().Side(aSide); aValue.AppendFloat(nsPresContext::AppUnitsToFloatCSSPixels(coordVal)); aValue.AppendLiteral("px"); } void StyleInfo::FormatColor(const nscolor& aValue, nsString& aFormattedValue) { // Combine the string like rgb(R, G, B) from nscolor. diff --git a/accessible/src/base/nsAccessibilityService.cpp b/accessible/src/base/nsAccessibilityService.cpp --- a/accessible/src/base/nsAccessibilityService.cpp +++ b/accessible/src/base/nsAccessibilityService.cpp @@ -257,17 +257,17 @@ NS_IMPL_ISUPPORTS1(PluginTimerCallBack, already_AddRefed nsAccessibilityService::CreatePluginAccessible(nsObjectFrame* aFrame, nsIContent* aContent, Accessible* aContext) { // nsObjectFrame means a plugin, so we need to use the accessibility support // of the plugin. - if (aFrame->GetRect().IsEmpty()) + if (aFrame->GetPhysicalRect().IsEmpty()) return nullptr; #if defined(XP_WIN) || defined(MOZ_ACCESSIBILITY_ATK) nsRefPtr pluginInstance; if (NS_SUCCEEDED(aFrame->GetPluginInstance(getter_AddRefs(pluginInstance))) && pluginInstance) { #ifdef XP_WIN if (!sPendingPlugins->Contains(aContent) && diff --git a/accessible/src/generic/Accessible.cpp b/accessible/src/generic/Accessible.cpp --- a/accessible/src/generic/Accessible.cpp +++ b/accessible/src/generic/Accessible.cpp @@ -642,21 +642,21 @@ Accessible::VisibilityState() return states::OFFSCREEN; NS_NOTREACHED("Children of not selected deck panel are not accessible."); return states::INVISIBLE; } // If contained by scrollable frame then check that at least 12 pixels // around the object is visible, otherwise the object is offscreen. - framePos += curFrame->GetPosition(); + framePos += curFrame->GetPhysicalPosition(); nsIScrollableFrame* scrollableFrame = do_QueryFrame(parentFrame); if (scrollableFrame) { nsRect scrollPortRect = scrollableFrame->GetScrollPortRect(); - nsRect frameRect(framePos, frame->GetSize()); + nsRect frameRect(framePos, frame->GetPhysicalSize()); if (!scrollPortRect.Contains(frameRect)) { const nscoord kMinPixels = nsPresContext::CSSPixelsToAppUnits(12); scrollPortRect.Deflate(kMinPixels, kMinPixels); if (!scrollPortRect.Intersects(frameRect)) return states::OFFSCREEN; } } @@ -671,17 +671,17 @@ Accessible::VisibilityState() // Zero area rects can occur in the first frame of a multi-frame text flow, // in which case the rendered text is not empty and the frame should not be // marked invisible. // XXX Can we just remove this check? Why do we need to mark empty // text invisible? if (frame->GetType() == nsGkAtoms::textFrame && !(frame->GetStateBits() & NS_FRAME_OUT_OF_FLOW) && - frame->GetRect().IsEmpty()) { + frame->GetPhysicalRect().IsEmpty()) { nsAutoString renderedText; frame->GetRenderedText(&renderedText, nullptr, nullptr, 0, 1); if (renderedText.IsEmpty()) return states::INVISIBLE; } return 0; } @@ -2295,17 +2295,17 @@ Accessible::DispatchClickEvent(nsIConten return; // Compute x and y coordinates. nsPoint point; nsCOMPtr widget = frame->GetNearestWidget(point); if (!widget) return; - nsSize size = frame->GetSize(); + nsSize size = frame->GetPhysicalSize(); nsRefPtr presContext = presShell->GetPresContext(); int32_t x = presContext->AppUnitsToDevPixels(point.x + size.width / 2); int32_t y = presContext->AppUnitsToDevPixels(point.y + size.height / 2); // Simulate a touch interaction by dispatching touch events with mouse events. nsCoreUtils::DispatchTouchEvent(NS_TOUCH_START, x, y, aContent, frame, presShell, widget); nsCoreUtils::DispatchMouseEvent(NS_MOUSE_BUTTON_DOWN, x, y, aContent, frame, presShell, widget); diff --git a/accessible/src/generic/DocAccessible.cpp b/accessible/src/generic/DocAccessible.cpp --- a/accessible/src/generic/DocAccessible.cpp +++ b/accessible/src/generic/DocAccessible.cpp @@ -660,17 +660,17 @@ DocAccessible::GetBoundsRect(nsRect& aBo nsIScrollableFrame* sf = presShell->GetRootScrollFrameAsScrollableExternal(); if (sf) { scrollPort = sf->GetScrollPortRect(); } else { nsIFrame* rootFrame = presShell->GetRootFrame(); if (!rootFrame) { return; } - scrollPort = rootFrame->GetRect(); + scrollPort = rootFrame->GetPhysicalRect(); } if (parentDoc) { // After first time thru loop // XXXroc bogus code! scrollPort is relative to the viewport of // this document, but we're intersecting rectangles derived from // multiple documents and assuming they're all in the same coordinate // system. See bug 514117. aBounds.IntersectRect(scrollPort, aBounds); diff --git a/accessible/src/generic/HyperTextAccessible.cpp b/accessible/src/generic/HyperTextAccessible.cpp --- a/accessible/src/generic/HyperTextAccessible.cpp +++ b/accessible/src/generic/HyperTextAccessible.cpp @@ -1323,17 +1323,17 @@ HyperTextAccessible::GetOffsetAtPoint(in nsIFrame *primaryFrame = childAcc->GetFrame(); NS_ENSURE_TRUE(primaryFrame, NS_ERROR_FAILURE); nsIFrame *frame = primaryFrame; while (frame) { nsIContent *content = frame->GetContent(); NS_ENSURE_TRUE(content, NS_ERROR_FAILURE); nsPoint pointInFrame = pointInHyperText - frame->GetOffsetTo(hyperFrame); - nsSize frameSize = frame->GetSize(); + nsSize frameSize = frame->GetPhysicalSize(); if (pointInFrame.x < frameSize.width && pointInFrame.y < frameSize.height) { // Finished if (frame->GetType() == nsGkAtoms::textFrame) { nsIFrame::ContentOffsets contentOffsets = frame->GetContentOffsetsFromPointExternal(pointInFrame, nsIFrame::IGNORE_SELECTION_STYLE); if (contentOffsets.IsNull() || contentOffsets.content != content) { return NS_OK; // Not found, will return -1 } @@ -1978,17 +1978,17 @@ HyperTextAccessible::ScrollSubstringToPo if (scrollableFrame) { if (!initialScrolled) { // Scroll substring to the given point. Turn the point into percents // relative scrollable area to use nsCoreUtils::ScrollSubstringTo. nsRect frameRect = parentFrame->GetScreenRectInAppUnits(); nscoord offsetPointX = coordsInAppUnits.x - frameRect.x; nscoord offsetPointY = coordsInAppUnits.y - frameRect.y; - nsSize size(parentFrame->GetSize()); + nsSize size(parentFrame->GetPhysicalSize()); // avoid divide by zero size.width = size.width ? size.width : 1; size.height = size.height ? size.height : 1; int16_t hPercent = offsetPointX * 100 / size.width; int16_t vPercent = offsetPointY * 100 / size.height; diff --git a/accessible/src/html/HTMLSelectAccessible.cpp b/accessible/src/html/HTMLSelectAccessible.cpp --- a/accessible/src/html/HTMLSelectAccessible.cpp +++ b/accessible/src/html/HTMLSelectAccessible.cpp @@ -663,17 +663,17 @@ HTMLComboboxListAccessible::GetBoundsRec } nsIFrame* frame = content->GetPrimaryFrame(); if (!frame) { *aBoundingFrame = nullptr; return; } *aBoundingFrame = frame->GetParent(); - aBounds = (*aBoundingFrame)->GetRect(); + aBounds = (*aBoundingFrame)->GetPhysicalRect(); } //////////////////////////////////////////////////////////////////////////////// // HTMLComboboxListAccessible: Widgets bool HTMLComboboxListAccessible::IsActiveWidget() const { diff --git a/accessible/src/html/HTMLTableAccessible.cpp b/accessible/src/html/HTMLTableAccessible.cpp --- a/accessible/src/html/HTMLTableAccessible.cpp +++ b/accessible/src/html/HTMLTableAccessible.cpp @@ -1080,19 +1080,19 @@ HTMLTableAccessible::IsProbablyLayoutTab // Check for many rows const int32_t kMaxLayoutRows = 20; if (rows > kMaxLayoutRows) { // A ton of rows, this is probably for data RETURN_LAYOUT_ANSWER(false, ">= kMaxLayoutRows (20) and non-bordered"); } // Check for very wide table. nsIFrame* documentFrame = Document()->GetFrame(); - nsSize documentSize = documentFrame->GetSize(); + nsSize documentSize = documentFrame->GetPhysicalSize(); if (documentSize.width > 0) { - nsSize tableSize = GetFrame()->GetSize(); + nsSize tableSize = GetFrame()->GetPhysicalSize(); int32_t percentageOfDocWidth = (100 * tableSize.width) / documentSize.width; if (percentageOfDocWidth > 95) { // 3-4 columns, no borders, not a lot of rows, and 95% of the doc's width // Probably for layout RETURN_LAYOUT_ANSWER(true, "<= 4 columns, table width is 95% of document width"); } } diff --git a/content/base/src/nsRange.cpp b/content/base/src/nsRange.cpp --- a/content/base/src/nsRange.cpp +++ b/content/base/src/nsRange.cpp @@ -2772,17 +2772,17 @@ static nsresult GetPartialTextRect(nsLay int32_t fstart = f->GetContentOffset(), fend = f->GetContentEnd(); if (fend <= aStartOffset || fstart >= aEndOffset) continue; // overlapping with the offset we want f->EnsureTextRun(nsTextFrame::eInflated); NS_ENSURE_TRUE(f->GetTextRun(nsTextFrame::eInflated), NS_ERROR_OUT_OF_MEMORY); bool rtl = f->GetTextRun(nsTextFrame::eInflated)->IsRightToLeft(); - nsRect r(f->GetOffsetTo(relativeTo), f->GetSize()); + nsRect r(f->GetOffsetTo(relativeTo), f->GetPhysicalSize()); if (fstart < aStartOffset) { // aStartOffset is within this frame ExtractRectFromOffset(f, relativeTo, aStartOffset, &r, rtl); } if (fend > aEndOffset) { // aEndOffset is in the middle of this frame ExtractRectFromOffset(f, relativeTo, aEndOffset, &r, !rtl); } @@ -2826,17 +2826,17 @@ static void CollectClientRects(nsLayoutU if (textFrame) { int32_t outOffset; nsIFrame* outFrame; textFrame->GetChildFrameContainingOffset(aStartOffset, false, &outOffset, &outFrame); if (outFrame) { nsIFrame* relativeTo = nsLayoutUtils::GetContainingBlockForClientRect(outFrame); - nsRect r(outFrame->GetOffsetTo(relativeTo), outFrame->GetSize()); + nsRect r(outFrame->GetOffsetTo(relativeTo), outFrame->GetPhysicalSize()); ExtractRectFromOffset(outFrame, relativeTo, aStartOffset, &r, false); r.width = 0; aCollector->AddRect(r); } } } return; } diff --git a/content/events/src/nsContentEventHandler.cpp b/content/events/src/nsContentEventHandler.cpp --- a/content/events/src/nsContentEventHandler.cpp +++ b/content/events/src/nsContentEventHandler.cpp @@ -604,17 +604,17 @@ nsContentEventHandler::OnQueryTextRect(n if (!node) { node = AdjustTextRectNode(range->GetStartParent(), offset); } nsIFrame* firstFrame = nullptr; rv = GetFrameForTextRect(node, offset, true, &firstFrame); NS_ENSURE_SUCCESS(rv, rv); // get the starting frame rect - nsRect rect(nsPoint(0, 0), firstFrame->GetRect().Size()); + nsRect rect(nsPoint(0, 0), firstFrame->GetPhysicalRect().Size()); rv = ConvertToRootViewRelativeOffset(firstFrame, rect); NS_ENSURE_SUCCESS(rv, rv); nsRect frameRect = rect; nsPoint ptOffset; firstFrame->GetPointFromOffset(offset, &ptOffset); // minus 1 to avoid creating an empty rect rect.x += ptOffset.x - 1; rect.width -= ptOffset.x - 1; @@ -639,29 +639,29 @@ nsContentEventHandler::OnQueryTextRect(n continue; frame = static_cast(node)->GetPrimaryFrame(); } while (!frame && !iter->IsDone()); if (!frame) { // this can happen when the end offset of the range is 0. frame = lastFrame; } } - frameRect.SetRect(nsPoint(0, 0), frame->GetRect().Size()); + frameRect.SetRect(nsPoint(0, 0), frame->GetPhysicalRect().Size()); rv = ConvertToRootViewRelativeOffset(frame, frameRect); NS_ENSURE_SUCCESS(rv, rv); if (frame != lastFrame) { // not last frame, so just add rect to previous result rect.UnionRect(rect, frameRect); } } // get the ending frame rect lastFrame->GetPointFromOffset(offset, &ptOffset); // minus 1 to avoid creating an empty rect - frameRect.width -= lastFrame->GetRect().width - ptOffset.x - 1; + frameRect.width -= lastFrame->GetPhysicalRect().width - ptOffset.x - 1; if (firstFrame == lastFrame) { rect.IntersectRect(rect, frameRect); } else { rect.UnionRect(rect, frameRect); } aEvent->mReply.mRect = rect.ToOutsidePixels(mPresContext->AppUnitsPerDevPixel()); @@ -675,23 +675,23 @@ nsContentEventHandler::OnQueryEditorRect nsresult rv = Init(aEvent); if (NS_FAILED(rv)) return rv; nsIFrame* frame = mRootContent->GetPrimaryFrame(); NS_ENSURE_TRUE(frame, NS_ERROR_FAILURE); // get rect for first frame - nsRect resultRect(nsPoint(0, 0), frame->GetRect().Size()); + nsRect resultRect(nsPoint(0, 0), frame->GetPhysicalRect().Size()); rv = ConvertToRootViewRelativeOffset(frame, resultRect); NS_ENSURE_SUCCESS(rv, rv); // account for any additional frames while ((frame = frame->GetNextContinuation()) != nullptr) { - nsRect frameRect(nsPoint(0, 0), frame->GetRect().Size()); + nsRect frameRect(nsPoint(0, 0), frame->GetPhysicalRect().Size()); rv = ConvertToRootViewRelativeOffset(frame, frameRect); NS_ENSURE_SUCCESS(rv, rv); resultRect.UnionRect(resultRect, frameRect); } aEvent->mReply.mRect = resultRect.ToOutsidePixels(mPresContext->AppUnitsPerDevPixel()); aEvent->mSucceeded = true; @@ -754,17 +754,17 @@ nsContentEventHandler::OnQueryCaretRect( nsPoint posInFrame; rv = frame->GetPointFromOffset(range->StartOffset(), &posInFrame); NS_ENSURE_SUCCESS(rv, rv); nsRect rect; rect.x = posInFrame.x; rect.y = posInFrame.y; rect.width = caret->GetCaretRect().width; - rect.height = frame->GetSize().height; + rect.height = frame->GetPhysicalSize().height; rv = ConvertToRootViewRelativeOffset(frame, rect); NS_ENSURE_SUCCESS(rv, rv); aEvent->mReply.mRect = rect.ToOutsidePixels(mPresContext->AppUnitsPerDevPixel()); aEvent->mSucceeded = true; return NS_OK; diff --git a/content/xul/document/src/XULDocument.cpp b/content/xul/document/src/XULDocument.cpp --- a/content/xul/document/src/XULDocument.cpp +++ b/content/xul/document/src/XULDocument.cpp @@ -1452,17 +1452,17 @@ XULDocument::GetViewportSize(int32_t* aW FlushPendingNotifications(Flush_Layout); nsIPresShell *shell = GetShell(); NS_ENSURE_TRUE(shell, NS_ERROR_FAILURE); nsIFrame* frame = shell->GetRootFrame(); NS_ENSURE_TRUE(frame, NS_ERROR_FAILURE); - nsSize size = frame->GetSize(); + nsSize size = frame->GetPhysicalSize(); *aWidth = nsPresContext::AppUnitsToIntCSSPixels(size.width); *aHeight = nsPresContext::AppUnitsToIntCSSPixels(size.height); return NS_OK; } NS_IMETHODIMP diff --git a/dom/base/nsDOMWindowUtils.cpp b/dom/base/nsDOMWindowUtils.cpp --- a/dom/base/nsDOMWindowUtils.cpp +++ b/dom/base/nsDOMWindowUtils.cpp @@ -1605,17 +1605,17 @@ nsDOMWindowUtils::GetRootBounds(nsIDOMCl nsIPresShell* presShell = doc->GetShell(); if (presShell) { nsIScrollableFrame* sf = presShell->GetRootScrollFrameAsScrollable(); if (sf) { bounds = sf->GetScrollRange(); bounds.width += sf->GetScrollPortRect().width; bounds.height += sf->GetScrollPortRect().height; } else if (presShell->GetRootFrame()) { - bounds = presShell->GetRootFrame()->GetRect(); + bounds = presShell->GetRootFrame()->GetPhysicalRect(); } } nsRefPtr rect = new nsClientRect(window); rect->SetRect(nsPresContext::AppUnitsToFloatCSSPixels(bounds.x), nsPresContext::AppUnitsToFloatCSSPixels(bounds.y), nsPresContext::AppUnitsToFloatCSSPixels(bounds.width), nsPresContext::AppUnitsToFloatCSSPixels(bounds.height)); diff --git a/layout/base/PositionedEventTargeting.cpp b/layout/base/PositionedEventTargeting.cpp --- a/layout/base/PositionedEventTargeting.cpp +++ b/layout/base/PositionedEventTargeting.cpp @@ -255,17 +255,17 @@ GetClosest(nsIFrame* aRoot, const nsPoin // Lower is better; distance is in appunits float bestDistance = 1e6f; nsRegion exposedRegion(aTargetRect); for (uint32_t i = 0; i < aCandidates.Length(); ++i) { nsIFrame* f = aCandidates[i]; bool preservesAxisAlignedRectangles = false; nsRect borderBox = nsLayoutUtils::TransformFrameRectToAncestor(f, - nsRect(nsPoint(0, 0), f->GetSize()), aRoot, &preservesAxisAlignedRectangles); + nsRect(nsPoint(0, 0), f->GetPhysicalSize()), aRoot, &preservesAxisAlignedRectangles); nsRegion region; region.And(exposedRegion, borderBox); if (region.IsEmpty()) { continue; } if (preservesAxisAlignedRectangles) { diff --git a/layout/base/RestyleManager.cpp b/layout/base/RestyleManager.cpp --- a/layout/base/RestyleManager.cpp +++ b/layout/base/RestyleManager.cpp @@ -370,17 +370,17 @@ RestyleManager::RecomputePosition(nsIFra aFrame, size.width, size.height, newOffsets); NS_ASSERTION(newOffsets.left == -newOffsets.right && newOffsets.top == -newOffsets.bottom, "ComputeRelativeOffsets should return valid results"); // nsHTMLReflowState::ApplyRelativePositioning would work here, but // since we've already checked mPosition and aren't changing the frame's // normal position, go ahead and add the offsets directly. - aFrame->SetPosition(aFrame->GetNormalPosition() + + aFrame->SetPosition(aFrame->GetNormalPhysicalPosition() + nsPoint(newOffsets.left, newOffsets.top)); } return true; } // For absolute positioning, the width can potentially change if width is // auto and either of left or right are not. The height can also potentially @@ -396,43 +396,43 @@ RestyleManager::RecomputePosition(nsIFra // For the absolute positioning case, set up a fake HTML reflow state for // the frame, and then get the offsets from it. nsRefPtr rc = aFrame->PresContext()->GetPresShell()-> GetReferenceRenderingContext(); // Construct a bogus parent reflow state so that there's a usable // containing block reflow state. nsIFrame* parentFrame = aFrame->GetParent(); - nsSize parentSize = parentFrame->GetSize(); + nsSize parentSize = parentFrame->GetPhysicalSize(); nsFrameState savedState = parentFrame->GetStateBits(); nsHTMLReflowState parentReflowState(aFrame->PresContext(), parentFrame, rc, parentSize); parentFrame->RemoveStateBits(~nsFrameState(0)); parentFrame->AddStateBits(savedState); NS_WARN_IF_FALSE(parentSize.width != NS_INTRINSICSIZE && parentSize.height != NS_INTRINSICSIZE, "parentSize should be valid"); parentReflowState.SetComputedWidth(std::max(parentSize.width, 0)); parentReflowState.SetComputedHeight(std::max(parentSize.height, 0)); parentReflowState.mComputedMargin.SizeTo(0, 0, 0, 0); parentSize.height = NS_AUTOHEIGHT; - parentReflowState.mComputedPadding = parentFrame->GetUsedPadding(); + parentReflowState.mComputedPadding = parentFrame->GetUsedPhysicalPadding(); parentReflowState.mComputedBorderPadding = - parentFrame->GetUsedBorderAndPadding(); + parentFrame->GetUsedPhysicalBorderAndPadding(); nsSize availSize(parentSize.width, NS_INTRINSICSIZE); - nsSize size = aFrame->GetSize(); + nsSize size = aFrame->GetPhysicalSize(); ViewportFrame* viewport = do_QueryFrame(parentFrame); nsSize cbSize = viewport ? viewport->AdjustReflowStateAsContainingBlock(&parentReflowState).Size() - : aFrame->GetContainingBlock()->GetSize(); + : aFrame->GetContainingBlock()->GetPhysicalSize(); const nsMargin& parentBorder = parentReflowState.mStyleBorder->GetComputedBorder(); cbSize -= nsSize(parentBorder.LeftRight(), parentBorder.TopBottom()); nsHTMLReflowState reflowState(aFrame->PresContext(), parentReflowState, aFrame, availSize, cbSize.width, cbSize.height); // If we're solving for 'left' or 'top', then compute it here, in order to diff --git a/layout/base/RestyleTracker.h b/layout/base/RestyleTracker.h --- a/layout/base/RestyleTracker.h +++ b/layout/base/RestyleTracker.h @@ -95,17 +95,17 @@ public: bool updateParent = false; if (entry->mInitial) { nsOverflowAreas* pre = static_cast (frame->Properties().Get(frame->PreTransformOverflowAreasProperty())); if (pre) { // FinishAndStoreOverflow will change the overflow areas passed in, // so make a copy. nsOverflowAreas overflowAreas = *pre; - frame->FinishAndStoreOverflow(overflowAreas, frame->GetSize()); + frame->FinishAndStoreOverflow(overflowAreas, frame->GetPhysicalSize()); // We can't tell if the overflow changed, so update the parent regardless updateParent = true; } } // If the overflow changed, then we want to also update the parent's // overflow. We always update the parent for initial frames. if (!updateParent) { diff --git a/layout/base/nsBidiPresUtils.cpp b/layout/base/nsBidiPresUtils.cpp --- a/layout/base/nsBidiPresUtils.cpp +++ b/layout/base/nsBidiPresUtils.cpp @@ -1358,27 +1358,27 @@ nsBidiPresUtils::RepositionFrame(nsIFram if (isRightMost) aFrame->AddStateBits(NS_INLINE_FRAME_BIDI_VISUAL_IS_RIGHT_MOST); else aFrame->RemoveStateBits(NS_INLINE_FRAME_BIDI_VISUAL_IS_RIGHT_MOST); } // This method is called from nsBlockFrame::PlaceLine via the call to // bidiUtils->ReorderFrames, so this is guaranteed to be after the inlines - // have been reflowed, which is required for GetUsedMargin/Border/Padding - nsMargin margin = aFrame->GetUsedMargin(); + // have been reflowed, which is required for GetUsedPhysicalMargin/Border/Padding + nsMargin margin = aFrame->GetUsedPhysicalMargin(); if (isLeftMost) aLeft += margin.left; nscoord start = aLeft; if (!IsBidiLeaf(aFrame)) { nscoord x = 0; - nsMargin borderPadding = aFrame->GetUsedBorderAndPadding(); + nsMargin borderPadding = aFrame->GetUsedPhysicalBorderAndPadding(); if (isLeftMost) { x += borderPadding.left; } // If aIsOddLevel is true, so we need to traverse the child list // in reverse order, to make it O(n) we store the list locally and // iterate the list reversely nsTArray childList; @@ -1405,19 +1405,19 @@ nsBidiPresUtils::RepositionFrame(nsIFram frame->GetNextSibling(); } if (isRightMost) { x += borderPadding.right; } aLeft += x; } else { - aLeft += aFrame->GetSize().width; + aLeft += aFrame->GetPhysicalSize().width; } - nsRect rect = aFrame->GetRect(); + nsRect rect = aFrame->GetPhysicalRect(); aFrame->SetRect(nsRect(start, rect.y, aLeft - start, rect.height)); if (isRightMost) aLeft += margin.right; } void nsBidiPresUtils::InitContinuationStates(nsIFrame* aFrame, @@ -1444,23 +1444,23 @@ nsBidiPresUtils::RepositionInlineFrames( nsIFrame* aFirstChild) { const nsStyleVisibility* vis = aFirstChild->StyleVisibility(); bool isLTR = (NS_STYLE_DIRECTION_LTR == vis->mDirection); nscoord leftSpace = 0; // This method is called from nsBlockFrame::PlaceLine via the call to // bidiUtils->ReorderFrames, so this is guaranteed to be after the inlines - // have been reflowed, which is required for GetUsedMargin/Border/Padding - nsMargin margin = aFirstChild->GetUsedMargin(); + // have been reflowed, which is required for GetUsedPhysicalMargin/Border/Padding + nsMargin margin = aFirstChild->GetUsedPhysicalMargin(); if (!aFirstChild->GetPrevContinuation() && !nsLayoutUtils::FrameIsNonFirstInIBSplit(aFirstChild)) leftSpace = isLTR ? margin.left : margin.right; - nscoord left = aFirstChild->GetPosition().x - leftSpace; + nscoord left = aFirstChild->GetPhysicalPosition().x - leftSpace; nsIFrame* frame; int32_t count = aBld->mVisualFrames.Length(); int32_t index; nsContinuationStates continuationStates; // Initialize continuation states to (nullptr, 0) for // each frame on the line. for (index = 0; index < count; index++) { diff --git a/layout/base/nsCSSRendering.cpp b/layout/base/nsCSSRendering.cpp --- a/layout/base/nsCSSRendering.cpp +++ b/layout/base/nsCSSRendering.cpp @@ -99,59 +99,59 @@ struct InlineBackgroundData nsIFrame* inlineFrame = aFrame->GetPrevContinuation(); // If the continuation is fluid we know inlineFrame is not on the same line. // If it's not fluid, we need to test further to be sure. while (inlineFrame && !inlineFrame->GetNextInFlow() && AreOnSameLine(aFrame, inlineFrame)) { nscoord frameXOffset = inlineFrame->GetOffsetTo(mBlockFrame).x; if(isRtlBlock == (frameXOffset >= curOffset)) { - x += inlineFrame->GetSize().width; + x += inlineFrame->GetPhysicalSize().width; } inlineFrame = inlineFrame->GetPrevContinuation(); } inlineFrame = aFrame->GetNextContinuation(); while (inlineFrame && !inlineFrame->GetPrevInFlow() && AreOnSameLine(aFrame, inlineFrame)) { nscoord frameXOffset = inlineFrame->GetOffsetTo(mBlockFrame).x; if(isRtlBlock == (frameXOffset >= curOffset)) { - x += inlineFrame->GetSize().width; + x += inlineFrame->GetPhysicalSize().width; } inlineFrame = inlineFrame->GetNextContinuation(); } if (isRtlBlock) { // aFrame itself is also to the right of its left edge, so add its width. - x += aFrame->GetSize().width; + x += aFrame->GetPhysicalSize().width; // x is now the distance from the left edge of aFrame to the right edge // of the unbroken content. Change it to indicate the distance from the // left edge of the unbroken content to the left edge of aFrame. x = mUnbrokenWidth - x; } } else { x = mContinuationPoint; } // Assume background-origin: border and return a rect with offsets // relative to (0,0). If we have a different background-origin, // then our rect should be deflated appropriately by our caller. - return nsRect(-x, 0, mUnbrokenWidth, mFrame->GetSize().height); + return nsRect(-x, 0, mUnbrokenWidth, mFrame->GetPhysicalSize().height); } nsRect GetBoundingRect(nsIFrame* aFrame) { SetFrame(aFrame); // Move the offsets relative to (0,0) which puts the bounding box into // our coordinate system rather than our parent's. We do this by // moving it the back distance from us to the bounding box. // This also assumes background-origin: border, so our caller will // need to deflate us if needed. nsRect boundingBox(mBoundingBox); - nsPoint point = mFrame->GetPosition(); + nsPoint point = mFrame->GetPhysicalPosition(); boundingBox.MoveBy(-point.x, -point.y); return boundingBox; } protected: nsIFrame* mFrame; nsBlockFrame* mBlockFrame; @@ -177,17 +177,17 @@ protected: // Ok, we've got the wrong frame. We have to start from scratch. Reset(); Init(aFrame); return; } // Get our last frame's size and add its width to our continuation // point before we cache the new frame. - mContinuationPoint += mFrame->GetSize().width; + mContinuationPoint += mFrame->GetPhysicalSize().width; // If this a new line, update mLineContinuationPoint. if (mBidiEnabled && (aFrame->GetPrevInFlow() || !AreOnSameLine(mFrame, aFrame))) { mLineContinuationPoint = mContinuationPoint; } mFrame = aFrame; @@ -243,31 +243,31 @@ protected: NS_ASSERTION(mBlockFrame, "Cannot find containing block."); } // Start with the previous flow frame as our continuation point // is the total of the widths of the previous frames. nsIFrame* inlineFrame = GetPrevContinuation(aFrame); while (inlineFrame) { - nsRect rect = inlineFrame->GetRect(); + nsRect rect = inlineFrame->GetPhysicalRect(); mContinuationPoint += rect.width; if (mBidiEnabled && !AreOnSameLine(aFrame, inlineFrame)) { mLineContinuationPoint += rect.width; } mUnbrokenWidth += rect.width; mBoundingBox.UnionRect(mBoundingBox, rect); inlineFrame = GetPrevContinuation(inlineFrame); } // Next add this frame and subsequent frames to the bounding box and // unbroken width. inlineFrame = aFrame; while (inlineFrame) { - nsRect rect = inlineFrame->GetRect(); + nsRect rect = inlineFrame->GetPhysicalRect(); mUnbrokenWidth += rect.width; mBoundingBox.UnionRect(mBoundingBox, rect); inlineFrame = GetNextContinuation(inlineFrame); } mFrame = aFrame; } @@ -654,17 +654,17 @@ nsCSSRendering::PaintBorderWithStyleBord border = aStyleBorder.GetComputedBorder(); if ((0 == border.left) && (0 == border.right) && (0 == border.top) && (0 == border.bottom)) { // Empty border area return; } - nsSize frameSize = aForFrame->GetSize(); + nsSize frameSize = aForFrame->GetPhysicalSize(); if (&aStyleBorder == aForFrame->StyleBorder() && frameSize == aBorderArea.Size()) { aForFrame->GetBorderRadii(twipsRadii); } else { nsIFrame::ComputeBorderRadii(aStyleBorder.mBorderRadius, frameSize, aBorderArea.Size(), aSkipSides, twipsRadii); } @@ -1225,17 +1225,17 @@ nsCSSRendering::PaintBoxShadowOuter(nsPr if (nativeTheme) { // Optimize non-leaf native-themed frames by skipping computing pixels // in the padding-box. We assume the padding-box is going to be painted // opaquely for non-leaf frames. // XXX this may not be a safe assumption; we should make this go away // by optimizing box-shadow drawing more for the cases where we don't have a skip-rect. useSkipGfxRect = !aForFrame->IsLeaf(); nsRect paddingRect = - aForFrame->GetPaddingRect() - aForFrame->GetPosition() + aFrameArea.TopLeft(); + aForFrame->GetPaddingRect() - aForFrame->GetPhysicalPosition() + aFrameArea.TopLeft(); skipGfxRect = nsLayoutUtils::RectToGfxRect(paddingRect, twipsPerPixel); } else if (hasBorderRadius) { skipGfxRect.Deflate(gfxMargin( std::max(borderRadii[C_TL].height, borderRadii[C_TR].height), 0, std::max(borderRadii[C_BL].height, borderRadii[C_BR].height), 0)); } for (uint32_t i = shadows->Length(); i > 0; --i) { @@ -1375,22 +1375,22 @@ nsCSSRendering::PaintBoxShadowInner(nsPr // box shadows since chrome can be aware of the platform theme. return; } // Get any border radius, since box-shadow must also have rounded corners // if the frame does. nscoord twipsRadii[8]; NS_ASSERTION(aForFrame->GetType() == nsGkAtoms::fieldSetFrame || - aFrameArea.Size() == aForFrame->GetSize(), "unexpected size"); + aFrameArea.Size() == aForFrame->GetPhysicalSize(), "unexpected size"); bool hasBorderRadius = aForFrame->GetBorderRadii(twipsRadii); nscoord twipsPerPixel = aPresContext->DevPixelsToAppUnits(1); nsRect paddingRect = aFrameArea; - nsMargin border = aForFrame->GetUsedBorder(); + nsMargin border = aForFrame->GetUsedPhysicalBorder(); aForFrame->ApplySkipSides(border); paddingRect.Deflate(border); gfxCornerSizes innerRadii; if (hasBorderRadius) { gfxCornerSizes borderRadii; ComputePixelRadii(twipsRadii, twipsPerPixel, &borderRadii); @@ -1704,47 +1704,47 @@ GetBackgroundClip(gfxContext *aCtx, uint // like the content. (See below.) // Therefore, only 'content-box' makes a difference here. if (aBackgroundClip == NS_STYLE_BG_CLIP_CONTENT) { nsIScrollableFrame* scrollableFrame = do_QueryFrame(aForFrame); // Clip at a rectangle attached to the scrolled content. aClipState->mHasAdditionalBGClipArea = true; aClipState->mAdditionalBGClipArea = nsRect( aClipState->mBGClipArea.TopLeft() - + scrollableFrame->GetScrolledFrame()->GetPosition() + + scrollableFrame->GetScrolledFrame()->GetPhysicalPosition() // For the dir=rtl case: + scrollableFrame->GetScrollRange().TopLeft(), scrollableFrame->GetScrolledRect().Size()); - nsMargin padding = aForFrame->GetUsedPadding(); + nsMargin padding = aForFrame->GetUsedPhysicalPadding(); // padding-bottom is ignored on scrollable frames: // https://bugzilla.mozilla.org/show_bug.cgi?id=748518 padding.bottom = 0; aForFrame->ApplySkipSides(padding); aClipState->mAdditionalBGClipArea.Deflate(padding); } // Also clip at a non-scrolling, rounded-corner 'padding-box', // same as the scrolled content because of the 'overflow' property. aBackgroundClip = NS_STYLE_BG_CLIP_PADDING; } if (aBackgroundClip != NS_STYLE_BG_CLIP_BORDER) { - nsMargin border = aForFrame->GetUsedBorder(); + nsMargin border = aForFrame->GetUsedPhysicalBorder(); if (aBackgroundClip == NS_STYLE_BG_CLIP_MOZ_ALMOST_PADDING) { // Reduce |border| by 1px (device pixels) on all sides, if // possible, so that we don't get antialiasing seams between the // background and border. border.top = std::max(0, border.top - aAppUnitsPerPixel); border.right = std::max(0, border.right - aAppUnitsPerPixel); border.bottom = std::max(0, border.bottom - aAppUnitsPerPixel); border.left = std::max(0, border.left - aAppUnitsPerPixel); } else if (aBackgroundClip != NS_STYLE_BG_CLIP_PADDING) { NS_ASSERTION(aBackgroundClip == NS_STYLE_BG_CLIP_CONTENT, "unexpected background-clip"); - border += aForFrame->GetUsedPadding(); + border += aForFrame->GetUsedPhysicalPadding(); } aForFrame->ApplySkipSides(border); aClipState->mBGClipArea.Deflate(border); if (aHaveRoundedCorners) { gfxFloat borderSizes[4] = { gfxFloat(border.top / aAppUnitsPerPixel), gfxFloat(border.right / aAppUnitsPerPixel), @@ -2599,17 +2599,17 @@ nsCSSRendering::PaintBackgroundWithSC(ns gfxContext *ctx = aRenderingContext.ThebesContext(); nscoord appUnitsPerPixel = aPresContext->AppUnitsPerDevPixel(); // Same coordinate space as aBorderArea & aBGClipRect gfxCornerSizes bgRadii; bool haveRoundedCorners; { nscoord radii[8]; - nsSize frameSize = aForFrame->GetSize(); + nsSize frameSize = aForFrame->GetPhysicalSize(); if (&aBorder == aForFrame->StyleBorder() && frameSize == aBorderArea.Size()) { haveRoundedCorners = aForFrame->GetBorderRadii(radii); } else { haveRoundedCorners = nsIFrame::ComputeBorderRadii(aBorder.mBorderRadius, frameSize, aBorderArea.Size(), aForFrame->GetSkipSides(), radii); } @@ -2788,17 +2788,17 @@ nsCSSRendering::PaintBackgroundColorWith gfxContext *ctx = aRenderingContext.ThebesContext(); nscoord appUnitsPerPixel = aPresContext->AppUnitsPerDevPixel(); // Same coordinate space as aBorderArea gfxCornerSizes bgRadii; bool haveRoundedCorners; { nscoord radii[8]; - nsSize frameSize = aForFrame->GetSize(); + nsSize frameSize = aForFrame->GetPhysicalSize(); if (&aBorder == aForFrame->StyleBorder() && frameSize == aBorderArea.Size()) { haveRoundedCorners = aForFrame->GetBorderRadii(radii); } else { haveRoundedCorners = nsIFrame::ComputeBorderRadii(aBorder.mBorderRadius, frameSize, aBorderArea.Size(), aForFrame->GetSkipSides(), radii); } @@ -2885,53 +2885,53 @@ nsCSSRendering::ComputeBackgroundPositio } } else if (frameType == nsGkAtoms::canvasFrame) { geometryFrame = aForFrame->GetFirstPrincipalChild(); // geometryFrame might be null if this canvas is a page created // as an overflow container (e.g. the in-flow content has already // finished and this page only displays the continuations of // absolutely positioned content). if (geometryFrame) { - bgPositioningArea = geometryFrame->GetRect(); + bgPositioningArea = geometryFrame->GetPhysicalRect(); } } else if (frameType == nsGkAtoms::scrollFrame && NS_STYLE_BG_ATTACHMENT_LOCAL == aLayer.mAttachment) { nsIScrollableFrame* scrollableFrame = do_QueryFrame(aForFrame); bgPositioningArea = nsRect( - scrollableFrame->GetScrolledFrame()->GetPosition() + scrollableFrame->GetScrolledFrame()->GetPhysicalPosition() // For the dir=rtl case: + scrollableFrame->GetScrollRange().TopLeft(), scrollableFrame->GetScrolledRect().Size()); // The ScrolledRect’s size does not include the borders or scrollbars, // reverse the handling of background-origin // compared to the common case below. if (aLayer.mOrigin == NS_STYLE_BG_ORIGIN_BORDER) { - nsMargin border = geometryFrame->GetUsedBorder(); + nsMargin border = geometryFrame->GetUsedPhysicalBorder(); geometryFrame->ApplySkipSides(border); bgPositioningArea.Inflate(border); bgPositioningArea.Inflate(scrollableFrame->GetActualScrollbarSizes()); } else if (aLayer.mOrigin != NS_STYLE_BG_ORIGIN_PADDING) { - nsMargin padding = geometryFrame->GetUsedPadding(); + nsMargin padding = geometryFrame->GetUsedPhysicalPadding(); geometryFrame->ApplySkipSides(padding); bgPositioningArea.Deflate(padding); NS_ASSERTION(aLayer.mOrigin == NS_STYLE_BG_ORIGIN_CONTENT, "unknown background-origin value"); } *aAttachedToFrame = aForFrame; return bgPositioningArea; } else { bgPositioningArea = nsRect(nsPoint(0,0), aBorderArea.Size()); } // Background images are tiled over the 'background-clip' area // but the origin of the tiling is based on the 'background-origin' area if (aLayer.mOrigin != NS_STYLE_BG_ORIGIN_BORDER && geometryFrame) { - nsMargin border = geometryFrame->GetUsedBorder(); + nsMargin border = geometryFrame->GetUsedPhysicalBorder(); if (aLayer.mOrigin != NS_STYLE_BG_ORIGIN_PADDING) { - border += geometryFrame->GetUsedPadding(); + border += geometryFrame->GetUsedPhysicalPadding(); NS_ASSERTION(aLayer.mOrigin == NS_STYLE_BG_ORIGIN_CONTENT, "unknown background-origin value"); } geometryFrame->ApplySkipSides(border); bgPositioningArea.Deflate(border); } nsIFrame* attachedToFrame = aForFrame; @@ -2949,17 +2949,17 @@ nsCSSRendering::ComputeBackgroundPositio attachedToFrame = pageContentFrame; } // else this is an embedded shell and its root frame is what we want } // Set the background positioning area to the viewport's area // (relative to aForFrame) bgPositioningArea = - nsRect(-aForFrame->GetOffsetTo(attachedToFrame), attachedToFrame->GetSize()); + nsRect(-aForFrame->GetOffsetTo(attachedToFrame), attachedToFrame->GetPhysicalSize()); if (!pageContentFrame) { // Subtract the size of scrollbars. nsIScrollableFrame* scrollableFrame = aPresContext->PresShell()->GetRootScrollFrameAsScrollable(); if (scrollableFrame) { nsMargin scrollbars = scrollableFrame->GetActualScrollbarSizes(); bgPositioningArea.Deflate(scrollbars); @@ -3935,17 +3935,17 @@ nsCSSRendering::ExpandPaintingRectForDec // Note that when we paint the decoration lines in relative positioned // box, we should paint them like all of the boxes are positioned as static. nscoord frameXInBlockAppUnits = 0; for (nsIFrame* f = aFrame; f; f = f->GetParent()) { block = do_QueryFrame(f); if (block) { break; } - frameXInBlockAppUnits += f->GetNormalPosition().x; + frameXInBlockAppUnits += f->GetNormalPhysicalPosition().x; } NS_ENSURE_TRUE(block, aClippedRect); nsPresContext *pc = aFrame->PresContext(); gfxFloat frameXInBlock = pc->AppUnitsToGfxUnits(frameXInBlockAppUnits); int32_t rectXInBlock = int32_t(NS_round(frameXInBlock + aXInFrame)); int32_t extraLeft = diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -662,17 +662,17 @@ static void RecordFrameMetrics(nsIFrame* nsRect contentBounds = scrollableFrame->GetScrollRange(); contentBounds.width += scrollableFrame->GetScrollPortRect().width; contentBounds.height += scrollableFrame->GetScrollPortRect().height; metrics.mScrollableRect = CSSRect::FromAppUnits(contentBounds); nsPoint scrollPosition = scrollableFrame->GetScrollPosition(); metrics.mScrollOffset = CSSPoint::FromAppUnits(scrollPosition); } else { - nsRect contentBounds = aForFrame->GetRect(); + nsRect contentBounds = aForFrame->GetPhysicalRect(); metrics.mScrollableRect = CSSRect::FromAppUnits(contentBounds); } metrics.mScrollId = aScrollId; nsIPresShell* presShell = presContext->GetPresShell(); if (metrics.mScrollId == FrameMetrics::ROOT_SCROLL_ID) { metrics.mResolution = ParentLayerToLayerScale(presShell->GetXResolution(), @@ -714,17 +714,17 @@ static void RecordFrameMetrics(nsIFrame* metrics.mMayHaveTouchListeners = aMayHaveTouchListeners; // Calculate the composition bounds as the size of the scroll frame and // its origin relative to the reference frame. // If aScrollFrame is null, we are in a document without a root scroll frame, // so it's a xul document. In this case, use the size of the viewport frame. nsIFrame* frameForCompositionBoundsCalculation = aScrollFrame ? aScrollFrame : aForFrame; nsRect compositionBounds(frameForCompositionBoundsCalculation->GetOffsetToCrossDoc(aReferenceFrame), - frameForCompositionBoundsCalculation->GetSize()); + frameForCompositionBoundsCalculation->GetPhysicalSize()); metrics.mCompositionBounds = RoundedToInt(LayoutDeviceRect::FromAppUnits(compositionBounds, auPerDevPixel) * metrics.mCumulativeResolution * layerToScreenScale); // For the root scroll frame of the root content document, clamp the // composition bounds to the widget bounds. This is necessary because, if // the page is zoomed in, the frame's size might be larger than the widget // bounds, but we don't want the composition bounds to be. @@ -1243,17 +1243,17 @@ void nsDisplayList::PaintForFrame(nsDisp bool mayHaveTouchListeners = false; if (document) { nsCOMPtr innerWin(document->GetInnerWindow()); if (innerWin) { mayHaveTouchListeners = innerWin->HasTouchEventListeners(); } } - nsRect viewport(aBuilder->ToReferenceFrame(aForFrame), aForFrame->GetSize()); + nsRect viewport(aBuilder->ToReferenceFrame(aForFrame), aForFrame->GetPhysicalSize()); RecordFrameMetrics(aForFrame, rootScrollFrame, aBuilder->FindReferenceFrameFor(aForFrame), root, mVisibleRect, viewport, (usingDisplayport ? &displayport : nullptr), (usingCriticalDisplayport ? &criticalDisplayport : nullptr), id, containerParameters, mayHaveTouchListeners); if (usingDisplayport && @@ -1646,17 +1646,17 @@ RegisterThemeGeometry(nsDisplayListBuild // Bail out if we're in a transformed subtree if (f->IsTransformed()) return; // Bail out if we're not in the displayRoot's document if (!f->GetParent() && f != displayRoot) return; } - nsRect borderBox(aFrame->GetOffsetTo(displayRoot), aFrame->GetSize()); + nsRect borderBox(aFrame->GetOffsetTo(displayRoot), aFrame->GetPhysicalSize()); aBuilder->RegisterThemeGeometry(aFrame->StyleDisplay()->mAppearance, borderBox.ToNearestPixels(aFrame->PresContext()->AppUnitsPerDevPixel())); } nsDisplayBackgroundImage::nsDisplayBackgroundImage(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, uint32_t aLayer, const nsStyleBackground* aBackgroundStyle) @@ -1774,23 +1774,23 @@ nsDisplayBackgroundImage::AppendBackgrou // Check that the rounded border of aFrame, added to aToReferenceFrame, // intersects aRect. Assumes that the unrounded border has already // been checked for intersection. static bool RoundedBorderIntersectsRect(nsIFrame* aFrame, const nsPoint& aFrameToReferenceFrame, const nsRect& aTestRect) { - if (!nsRect(aFrameToReferenceFrame, aFrame->GetSize()).Intersects(aTestRect)) + if (!nsRect(aFrameToReferenceFrame, aFrame->GetPhysicalSize()).Intersects(aTestRect)) return false; nscoord radii[8]; return !aFrame->GetBorderRadii(radii) || nsLayoutUtils::RoundedRectIntersectsRect(nsRect(aFrameToReferenceFrame, - aFrame->GetSize()), + aFrame->GetPhysicalSize()), radii, aTestRect); } // Returns TRUE if aContainedRect is guaranteed to be contained in // the rounded rect defined by aRoundedRect and aRadii. Complex cases are // handled conservatively by returning FALSE in some situations where // a more thorough analysis could return TRUE. // @@ -1810,17 +1810,17 @@ nsDisplayBackgroundImage::IsSingleFixedP if (!mBackgroundStyle) return false; if (mBackgroundStyle->mLayers.Length() != 1) return false; nsPresContext* presContext = mFrame->PresContext(); uint32_t flags = aBuilder->GetBackgroundPaintFlags(); - nsRect borderArea = nsRect(ToReferenceFrame(), mFrame->GetSize()); + nsRect borderArea = nsRect(ToReferenceFrame(), mFrame->GetPhysicalSize()); const nsStyleBackground::Layer &layer = mBackgroundStyle->mLayers[mLayer]; if (layer.mAttachment != NS_STYLE_BG_ATTACHMENT_FIXED) return false; nsBackgroundLayerState state = nsCSSRendering::PrepareBackgroundLayer(presContext, mFrame, @@ -1845,17 +1845,17 @@ bool nsDisplayBackgroundImage::TryOptimizeToImageLayer(LayerManager* aManager, nsDisplayListBuilder* aBuilder) { if (!mBackgroundStyle) return false; nsPresContext* presContext = mFrame->PresContext(); uint32_t flags = aBuilder->GetBackgroundPaintFlags(); - nsRect borderArea = nsRect(ToReferenceFrame(), mFrame->GetSize()); + nsRect borderArea = nsRect(ToReferenceFrame(), mFrame->GetPhysicalSize()); const nsStyleBackground::Layer &layer = mBackgroundStyle->mLayers[mLayer]; if (layer.mClip != NS_STYLE_BG_CLIP_BORDER) { return false; } nscoord radii[8]; if (mFrame->GetBorderRadii(radii)) { return false; @@ -2040,25 +2040,25 @@ nsDisplayBackgroundImage::GetInsideClipR nsIFrame *frame = aItem->Frame(); nscoord radii[8]; nsRect clipRect; bool haveRadii; switch (aClip) { case NS_STYLE_BG_CLIP_BORDER: haveRadii = frame->GetBorderRadii(radii); - clipRect = nsRect(aItem->ToReferenceFrame(), frame->GetSize()); + clipRect = nsRect(aItem->ToReferenceFrame(), frame->GetPhysicalSize()); break; case NS_STYLE_BG_CLIP_PADDING: haveRadii = frame->GetPaddingBoxBorderRadii(radii); - clipRect = frame->GetPaddingRect() - frame->GetPosition() + aItem->ToReferenceFrame(); + clipRect = frame->GetPaddingRect() - frame->GetPhysicalPosition() + aItem->ToReferenceFrame(); break; case NS_STYLE_BG_CLIP_CONTENT: haveRadii = frame->GetContentBoxBorderRadii(radii); - clipRect = frame->GetContentRect() - frame->GetPosition() + aItem->ToReferenceFrame(); + clipRect = frame->GetContentRect() - frame->GetPhysicalPosition() + aItem->ToReferenceFrame(); break; default: NS_NOTREACHED("Unknown clip type"); return result; } if (haveRadii) { *aSnap = false; @@ -2128,17 +2128,17 @@ nsRect nsDisplayBackgroundImage::GetPositioningArea() { if (!mBackgroundStyle) { return nsRect(); } nsIFrame* attachedToFrame; return nsCSSRendering::ComputeBackgroundPositioningArea( mFrame->PresContext(), mFrame, - nsRect(ToReferenceFrame(), mFrame->GetSize()), + nsRect(ToReferenceFrame(), mFrame->GetPhysicalSize()), *mBackgroundStyle, mBackgroundStyle->mLayers[mLayer], &attachedToFrame) + ToReferenceFrame(); } bool nsDisplayBackgroundImage::RenderingMightDependOnPositioningAreaSizeChange() { if (!mBackgroundStyle) @@ -2182,17 +2182,17 @@ nsDisplayBackgroundImage::PaintInternal( nsRenderingContext* aCtx, const nsRect& aBounds, nsRect* aClipRect) { nsPoint offset = ToReferenceFrame(); uint32_t flags = aBuilder->GetBackgroundPaintFlags(); CheckForBorderItem(this, flags); nsCSSRendering::PaintBackground(mFrame->PresContext(), *aCtx, mFrame, aBounds, - nsRect(offset, mFrame->GetSize()), + nsRect(offset, mFrame->GetPhysicalSize()), flags, aClipRect, mLayer); } void nsDisplayBackgroundImage::ComputeInvalidationRegion(nsDisplayListBuilder* aBuilder, const nsDisplayItemGeometry* aGeometry, nsRegion* aInvalidRegion) { @@ -2235,17 +2235,17 @@ nsDisplayBackgroundImage::GetBounds(nsDi nsRect nsDisplayBackgroundImage::GetBoundsInternal(nsDisplayListBuilder* aBuilder) { nsPresContext* presContext = mFrame->PresContext(); if (!mBackgroundStyle) { return nsRect(); } - nsRect borderBox = nsRect(ToReferenceFrame(), mFrame->GetSize()); + nsRect borderBox = nsRect(ToReferenceFrame(), mFrame->GetPhysicalSize()); nsRect clipRect = borderBox; if (mFrame->GetType() == nsGkAtoms::canvasFrame) { nsCanvasFrame* frame = static_cast(mFrame); clipRect = frame->CanvasArea() + ToReferenceFrame(); } const nsStyleBackground::Layer& layer = mBackgroundStyle->mLayers[mLayer]; return nsCSSRendering::GetBackgroundLayerRect(presContext, mFrame, borderBox, clipRect, @@ -2299,29 +2299,29 @@ nsDisplayThemedBackground::WriteDebugInf void nsDisplayThemedBackground::HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect, HitTestState* aState, nsTArray *aOutFrames) { // Assume that any point in our border rect is a hit. - if (nsRect(ToReferenceFrame(), mFrame->GetSize()).Intersects(aRect)) { + if (nsRect(ToReferenceFrame(), mFrame->GetPhysicalSize()).Intersects(aRect)) { aOutFrames->AppendElement(mFrame); } } nsRegion nsDisplayThemedBackground::GetOpaqueRegion(nsDisplayListBuilder* aBuilder, bool* aSnap) { nsRegion result; *aSnap = false; if (mThemeTransparency == nsITheme::eOpaque) { - result = nsRect(ToReferenceFrame(), mFrame->GetSize()); + result = nsRect(ToReferenceFrame(), mFrame->GetPhysicalSize()); } return result; } bool nsDisplayThemedBackground::IsUniform(nsDisplayListBuilder* aBuilder, nscolor* aColor) { if (mAppearance == NS_THEME_WIN_BORDERLESS_GLASS || mAppearance == NS_THEME_WIN_GLASS) { @@ -2329,17 +2329,17 @@ nsDisplayThemedBackground::IsUniform(nsD return true; } return false; } nsRect nsDisplayThemedBackground::GetPositioningArea() { - return nsRect(ToReferenceFrame(), mFrame->GetSize()); + return nsRect(ToReferenceFrame(), mFrame->GetPhysicalSize()); } void nsDisplayThemedBackground::Paint(nsDisplayListBuilder* aBuilder, nsRenderingContext* aCtx) { PaintInternal(aBuilder, aCtx, mVisibleRect, nullptr); } @@ -2347,17 +2347,17 @@ nsDisplayThemedBackground::Paint(nsDispl void nsDisplayThemedBackground::PaintInternal(nsDisplayListBuilder* aBuilder, nsRenderingContext* aCtx, const nsRect& aBounds, nsRect* aClipRect) { // XXXzw this ignores aClipRect. nsPresContext* presContext = mFrame->PresContext(); nsITheme *theme = presContext->GetTheme(); - nsRect borderArea(ToReferenceFrame(), mFrame->GetSize()); + nsRect borderArea(ToReferenceFrame(), mFrame->GetPhysicalSize()); nsRect drawing(borderArea); theme->GetWidgetOverflow(presContext->DeviceContext(), mFrame, mAppearance, &drawing); drawing.IntersectRect(drawing, aBounds); theme->DrawWidgetBackground(aCtx, mFrame, mAppearance, borderArea, drawing); } void nsDisplayThemedBackground::ComputeInvalidationRegion(nsDisplayListBuilder* aBuilder, @@ -2386,17 +2386,17 @@ nsDisplayThemedBackground::GetBounds(nsD *aSnap = true; return mBounds; } nsRect nsDisplayThemedBackground::GetBoundsInternal() { nsPresContext* presContext = mFrame->PresContext(); - nsRect r(nsPoint(0,0), mFrame->GetSize()); + nsRect r(nsPoint(0,0), mFrame->GetPhysicalSize()); presContext->GetTheme()-> GetWidgetOverflow(presContext->DeviceContext(), mFrame, mFrame->StyleDisplay()->mAppearance, &r); #ifdef XP_MACOSX // Bug 748219 r.Inflate(mFrame->PresContext()->AppUnitsPerDevPixel()); #endif @@ -2411,17 +2411,17 @@ nsDisplayBackgroundColor::Paint(nsDispla return; } nsPoint offset = ToReferenceFrame(); uint32_t flags = aBuilder->GetBackgroundPaintFlags(); CheckForBorderItem(this, flags); nsCSSRendering::PaintBackgroundColor(mFrame->PresContext(), *aCtx, mFrame, mVisibleRect, - nsRect(offset, mFrame->GetSize()), + nsRect(offset, mFrame->GetPhysicalSize()), flags); } nsRegion nsDisplayBackgroundColor::GetOpaqueRegion(nsDisplayListBuilder* aBuilder, bool* aSnap) { if (NS_GET_A(mColor) != 255) { @@ -2429,17 +2429,17 @@ nsDisplayBackgroundColor::GetOpaqueRegio } if (!mBackgroundStyle) return nsRegion(); *aSnap = true; const nsStyleBackground::Layer& bottomLayer = mBackgroundStyle->BottomLayer(); - nsRect borderBox = nsRect(ToReferenceFrame(), mFrame->GetSize()); + nsRect borderBox = nsRect(ToReferenceFrame(), mFrame->GetPhysicalSize()); nsPresContext* presContext = mFrame->PresContext(); return nsDisplayBackgroundImage::GetInsideClipRegion(this, presContext, bottomLayer.mClip, borderBox, aSnap); } bool nsDisplayBackgroundColor::IsUniform(nsDisplayListBuilder* aBuilder, nscolor* aColor) { *aColor = mColor; @@ -2473,31 +2473,31 @@ nsDisplayOutline::GetBounds(nsDisplayLis void nsDisplayOutline::Paint(nsDisplayListBuilder* aBuilder, nsRenderingContext* aCtx) { // TODO join outlines together nsPoint offset = ToReferenceFrame(); nsCSSRendering::PaintOutline(mFrame->PresContext(), *aCtx, mFrame, mVisibleRect, - nsRect(offset, mFrame->GetSize()), + nsRect(offset, mFrame->GetPhysicalSize()), mFrame->StyleContext()); } bool nsDisplayOutline::ComputeVisibility(nsDisplayListBuilder* aBuilder, nsRegion* aVisibleRegion, const nsRect& aAllowVisibleRegionExpansion) { if (!nsDisplayItem::ComputeVisibility(aBuilder, aVisibleRegion, aAllowVisibleRegionExpansion)) { return false; } const nsStyleOutline* outline = mFrame->StyleOutline(); - nsRect borderBox(ToReferenceFrame(), mFrame->GetSize()); + nsRect borderBox(ToReferenceFrame(), mFrame->GetPhysicalSize()); if (borderBox.Contains(aVisibleRegion->GetBounds()) && !nsLayoutUtils::HasNonZeroCorner(outline->mOutlineRadius)) { if (outline->mOutlineOffset >= 0) { // the visible region is entirely inside the border-rect, and the outline // isn't rendered inside the border-rect, so the outline is not visible return false; } } @@ -2531,17 +2531,17 @@ bool nsDisplayBorder::ComputeVisibility(nsDisplayListBuilder* aBuilder, nsRegion* aVisibleRegion, const nsRect& aAllowVisibleRegionExpansion) { if (!nsDisplayItem::ComputeVisibility(aBuilder, aVisibleRegion, aAllowVisibleRegionExpansion)) { return false; } - nsRect paddingRect = mFrame->GetPaddingRect() - mFrame->GetPosition() + + nsRect paddingRect = mFrame->GetPaddingRect() - mFrame->GetPhysicalPosition() + ToReferenceFrame(); const nsStyleBorder *styleBorder; if (paddingRect.Contains(aVisibleRegion->GetBounds()) && !(styleBorder = mFrame->StyleBorder())->IsBorderImageLoaded() && !nsLayoutUtils::HasNonZeroCorner(styleBorder->mBorderRadius)) { // the visible region is entirely inside the content rect, and no part // of the border is rendered inside the content rect, so we are not // visible @@ -2577,25 +2577,25 @@ nsDisplayBorder::ComputeInvalidationRegi } void nsDisplayBorder::Paint(nsDisplayListBuilder* aBuilder, nsRenderingContext* aCtx) { nsPoint offset = ToReferenceFrame(); nsCSSRendering::PaintBorder(mFrame->PresContext(), *aCtx, mFrame, mVisibleRect, - nsRect(offset, mFrame->GetSize()), + nsRect(offset, mFrame->GetPhysicalSize()), mFrame->StyleContext(), mFrame->GetSkipSides()); } nsRect nsDisplayBorder::GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap) { - nsRect borderBounds(ToReferenceFrame(), mFrame->GetSize()); + nsRect borderBounds(ToReferenceFrame(), mFrame->GetPhysicalSize()); borderBounds.Inflate(mFrame->StyleBorder()->GetImageOutset()); *aSnap = true; return borderBounds; } // Given a region, compute a conservative approximation to it as a list // of rectangles that aren't vertically adjacent (i.e., vertically // adjacent or overlapping rectangles are combined). @@ -2649,17 +2649,17 @@ nsDisplayBoxShadowOuter::Paint(nsDisplay nsRect nsDisplayBoxShadowOuter::GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap) { *aSnap = false; return mBounds; } nsRect nsDisplayBoxShadowOuter::GetBoundsInternal() { - return nsLayoutUtils::GetBoxShadowRectForFrame(mFrame, mFrame->GetSize()) + + return nsLayoutUtils::GetBoxShadowRectForFrame(mFrame, mFrame->GetPhysicalSize()) + ToReferenceFrame(); } bool nsDisplayBoxShadowOuter::ComputeVisibility(nsDisplayListBuilder* aBuilder, nsRegion* aVisibleRegion, const nsRect& aAllowVisibleRegionExpansion) { if (!nsDisplayItem::ComputeVisibility(aBuilder, aVisibleRegion, @@ -2667,17 +2667,17 @@ nsDisplayBoxShadowOuter::ComputeVisibili return false; } // Store the actual visible region mVisibleRegion.And(*aVisibleRegion, mVisibleRect); nsPoint origin = ToReferenceFrame(); nsRect visibleBounds = aVisibleRegion->GetBounds(); - nsRect frameRect(origin, mFrame->GetSize()); + nsRect frameRect(origin, mFrame->GetPhysicalSize()); if (!frameRect.Contains(visibleBounds)) return true; // the visible region is entirely inside the border-rect, and box shadows // never render within the border-rect (unless there's a border radius). nscoord twipsRadii[8]; bool hasBorderRadii = mFrame->GetBorderRadii(twipsRadii); if (!hasBorderRadii) @@ -2712,17 +2712,17 @@ nsDisplayBoxShadowOuter::ComputeInvalida } } void nsDisplayBoxShadowInner::Paint(nsDisplayListBuilder* aBuilder, nsRenderingContext* aCtx) { nsPoint offset = ToReferenceFrame(); - nsRect borderRect = nsRect(offset, mFrame->GetSize()); + nsRect borderRect = nsRect(offset, mFrame->GetPhysicalSize()); nsPresContext* presContext = mFrame->PresContext(); nsAutoTArray rects; ComputeDisjointRectangles(mVisibleRegion, &rects); PROFILER_LABEL("nsDisplayBoxShadowInner", "Paint"); for (uint32_t i = 0; i < rects.Length(); ++i) { aCtx->PushState(); aCtx->IntersectClip(rects[i]); @@ -3366,17 +3366,17 @@ nsDisplayFixedPosition::BuildLayer(nsDis nsRefPtr layer = nsDisplayOwnLayer::BuildLayer(aBuilder, aManager, aContainerParameters); nsIFrame* viewportFrame = mFixedPosFrame->GetParent(); nsPresContext *presContext = viewportFrame->PresContext(); // Fixed position frames are reflowed into the scroll-port size if one has // been set. - nsSize viewportSize = viewportFrame->GetSize(); + nsSize viewportSize = viewportFrame->GetPhysicalSize(); if (presContext->PresShell()->IsScrollPositionClampingScrollPortSizeSet()) { viewportSize = presContext->PresShell()-> GetScrollPositionClampingScrollPortSize(); } SetFixedPositionLayerData(layer, viewportFrame, viewportSize, presContext, aContainerParameters); @@ -3423,17 +3423,17 @@ nsDisplayStickyPosition::BuildLayer(nsDi return layer.forget(); } nsIFrame* scrollFrame = do_QueryFrame(stickyScrollContainer->ScrollFrame()); nsPresContext* presContext = scrollFrame->PresContext(); // Sticky position frames whose scroll frame is the root scroll frame are // reflowed into the scroll-port size if one has been set. - nsSize scrollFrameSize = scrollFrame->GetSize(); + nsSize scrollFrameSize = scrollFrame->GetPhysicalSize(); if (scrollFrame == presContext->PresShell()->GetRootScrollFrame() && presContext->PresShell()->IsScrollPositionClampingScrollPortSizeSet()) { scrollFrameSize = presContext->PresShell()-> GetScrollPositionClampingScrollPortSize(); } SetFixedPositionLayerData(layer, scrollFrame, scrollFrameSize, presContext, aContainerParameters); @@ -3531,18 +3531,18 @@ nsDisplayScrollLayer::BuildLayer(nsDispl BuildContainerLayerFor(aBuilder, aManager, mFrame, this, mList, aContainerParameters, nullptr); // Get the already set unique ID for scrolling this content remotely. // Or, if not set, generate a new ID. nsIContent* content = mScrolledFrame->GetContent(); ViewID scrollId = nsLayoutUtils::FindOrCreateIDFor(content); - nsRect viewport = mScrollFrame->GetRect() - - mScrollFrame->GetPosition() + + nsRect viewport = mScrollFrame->GetPhysicalRect() - + mScrollFrame->GetPhysicalPosition() + mScrollFrame->GetOffsetToCrossDoc(ReferenceFrame()); bool usingDisplayport = false; bool usingCriticalDisplayport = false; nsRect displayport, criticalDisplayport; if (content) { usingDisplayport = nsLayoutUtils::GetDisplayPort(content, &displayport); usingCriticalDisplayport = @@ -3817,17 +3817,17 @@ nsDisplayTransform::GetFrameBoundsForTra { NS_PRECONDITION(aFrame, "Can't get the bounds of a nonexistent frame!"); if (aFrame->GetStateBits() & NS_FRAME_SVG_LAYOUT) { // TODO: SVG needs to define what percentage translations resolve against. return nsRect(); } - return nsRect(nsPoint(0, 0), aFrame->GetSize()); + return nsRect(nsPoint(0, 0), aFrame->GetPhysicalSize()); } #else nsRect nsDisplayTransform::GetFrameBoundsForTransform(const nsIFrame* aFrame) { NS_PRECONDITION(aFrame, "Can't get the bounds of a nonexistent frame!"); @@ -3845,17 +3845,17 @@ nsDisplayTransform::GetFrameBoundsForTra for (const nsIFrame *currFrame = aFrame->GetFirstContinuation(); currFrame != nullptr; currFrame = currFrame->GetNextContinuation()) { /* Get the frame rect in local coordinates, then translate back to the * original coordinates. */ result.UnionRect(result, nsRect(currFrame->GetOffsetTo(aFrame), - currFrame->GetSize())); + currFrame->GetPhysicalSize())); } return result; } #endif nsDisplayTransform::nsDisplayTransform(nsDisplayListBuilder* aBuilder, nsIFrame *aFrame, @@ -3934,17 +3934,17 @@ nsDisplayTransform::GetDeltaToMozTransfo coords[index] = NSAppUnitsToFloatPixels(coord.GetCoordValue(), aAppUnitsPerPixel); } if ((aFrame->GetStateBits() & NS_FRAME_SVG_LAYOUT) && coord.GetUnit() != eStyleUnit_Percent) { // values represent offsets from the origin of the SVG element's // user space, not the top left of its bounds, so we must adjust for that: nscoord offset = - (index == 0) ? aFrame->GetPosition().x : aFrame->GetPosition().y; + (index == 0) ? aFrame->GetPhysicalPosition().x : aFrame->GetPhysicalPosition().y; coords[index] -= NSAppUnitsToFloatPixels(offset, aAppUnitsPerPixel); } } coords[2] = NSAppUnitsToFloatPixels(display->mTransformOrigin[2].GetCoordValue(), aAppUnitsPerPixel); /* Adjust based on the origin of the rectangle. */ coords[0] += NSAppUnitsToFloatPixels(boundingRect.x, aAppUnitsPerPixel); @@ -4146,17 +4146,17 @@ nsDisplayTransform::GetResultingTransfor frame->GetParent()->IsTransformed() && frame->GetParent()->Preserves3DChildren(), "Preserve3D mismatch!"); FrameTransformProperties props(frame->GetParent(), aAppUnitsPerPixel, nullptr); gfx3DMatrix parent = GetResultingTransformMatrixInternal(props, - aOrigin - frame->GetPosition(), + aOrigin - frame->GetPhysicalPosition(), aAppUnitsPerPixel, nullptr, aOutAncestor); return nsLayoutUtils::ChangeMatrixBasis(rounded + aProperties.mToMozOrigin, result) * parent; } return nsLayoutUtils::ChangeMatrixBasis (rounded + aProperties.mToMozOrigin, result); } @@ -4201,17 +4201,17 @@ nsDisplayTransform::ShouldPrerenderTrans nsCString message; message.AppendLiteral("Performance warning: Async animation disabled because frame was not marked active for transform animation"); CommonElementAnimationData::LogAsyncAnimationFailure(message, aFrame->GetContent()); } return false; } - nsSize refSize = aBuilder->RootReferenceFrame()->GetSize(); + nsSize refSize = aBuilder->RootReferenceFrame()->GetPhysicalSize(); // Only prerender if the transformed frame's size is <= the // reference frame size (~viewport), allowing a 1/8th fuzz factor // for shadows, borders, etc. refSize += nsSize(refSize.width / 8, refSize.height / 8); nsSize frameSize = aFrame->GetVisualOverflowRectRelativeToSelf().Size(); if (frameSize <= refSize) { // Bug 717521 - pre-render max 4096 x 4096 device pixels. nscoord max = aFrame->PresContext()->DevPixelsToAppUnits(4096); diff --git a/layout/base/nsDisplayList.h b/layout/base/nsDisplayList.h --- a/layout/base/nsDisplayList.h +++ b/layout/base/nsDisplayList.h @@ -515,17 +515,17 @@ public: mPrevCachedReferenceFrame(aBuilder->mCachedReferenceFrame), mPrevCachedOffset(aBuilder->mCachedOffset), mPrevIsAtRootOfPseudoStackingContext(aBuilder->mIsAtRootOfPseudoStackingContext), mPrevIsInFixedPosition(aBuilder->mIsInFixedPosition) { if (aForChild->IsTransformed()) { aBuilder->mCachedOffset = nsPoint(); aBuilder->mCachedReferenceFrame = aForChild; } else if (mPrevCachedOffsetFrame == aForChild->GetParent()) { - aBuilder->mCachedOffset += aForChild->GetPosition(); + aBuilder->mCachedOffset += aForChild->GetPhysicalPosition(); } else { aBuilder->mCachedOffset = aBuilder->ToReferenceFrame(aForChild); } aBuilder->mCachedOffsetFrame = aForChild; aBuilder->mIsAtRootOfPseudoStackingContext = aIsRoot; if (aIsInFixedPosition) { aBuilder->mIsInFixedPosition = aIsInFixedPosition; } @@ -841,26 +841,26 @@ public: * boundaries when *aSnap is set to false. * This does not take the item's clipping into account. * @return a rectangle relative to aBuilder->ReferenceFrame() that * contains the area drawn by this display item */ virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap) { *aSnap = false; - return nsRect(ToReferenceFrame(), Frame()->GetSize()); + return nsRect(ToReferenceFrame(), Frame()->GetPhysicalSize()); } /** * Returns the result of GetBounds intersected with the item's clip. * The intersection is approximate since rounded corners are not taking into * account. */ nsRect GetClippedBounds(nsDisplayListBuilder* aBuilder); nsRect GetBorderRect() { - return nsRect(ToReferenceFrame(), Frame()->GetSize()); + return nsRect(ToReferenceFrame(), Frame()->GetPhysicalSize()); } nsRect GetPaddingRect() { return Frame()->GetPaddingRectRelativeToSelf() + ToReferenceFrame(); } nsRect GetContentRect() { return Frame()->GetContentRectRelativeToSelf() + ToReferenceFrame(); } @@ -2152,17 +2152,17 @@ public: bool* aSnap) MOZ_OVERRIDE; virtual bool IsUniform(nsDisplayListBuilder* aBuilder, nscolor* aColor) MOZ_OVERRIDE; virtual void HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect, HitTestState* aState, nsTArray *aOutFrames) MOZ_OVERRIDE; virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap) MOZ_OVERRIDE { *aSnap = true; - return nsRect(ToReferenceFrame(), Frame()->GetSize()); + return nsRect(ToReferenceFrame(), Frame()->GetPhysicalSize()); } virtual nsDisplayItemGeometry* AllocateGeometry(nsDisplayListBuilder* aBuilder) MOZ_OVERRIDE { return new nsDisplayItemBoundsGeometry(this, aBuilder); } virtual void ComputeInvalidationRegion(nsDisplayListBuilder* aBuilder, diff --git a/layout/base/nsDocumentViewer.cpp b/layout/base/nsDocumentViewer.cpp --- a/layout/base/nsDocumentViewer.cpp +++ b/layout/base/nsDocumentViewer.cpp @@ -3812,17 +3812,17 @@ nsDocumentViewer::PrintPreviewNavigate(i aType = nsIWebBrowserPrint::PRINTPREVIEW_GOTO_PAGENUM; aPageNum = pageCount; } // Now, locate the current page we are on and // and the page of the page number nsIFrame* pageFrame = seqFrame->GetFirstPrincipalChild(); while (pageFrame != nullptr) { - nsRect pageRect = pageFrame->GetRect(); + nsRect pageRect = pageFrame->GetPhysicalRect(); if (pageRect.Contains(pageRect.x, pt.y)) { currentPage = pageFrame; } if (pageNum == aPageNum) { fndPageFrame = pageFrame; break; } pageNum++; @@ -3850,17 +3850,17 @@ nsDocumentViewer::PrintPreviewNavigate(i } else { // If we get here we are doing "GoTo" if (aPageNum < 0 || aPageNum > pageCount) { return NS_OK; } } if (fndPageFrame) { nscoord newYPosn = - nscoord(mPrintEngine->GetPrintPreviewScale() * fndPageFrame->GetPosition().y); + nscoord(mPrintEngine->GetPrintPreviewScale() * fndPageFrame->GetPhysicalPosition().y); sf->ScrollTo(nsPoint(pt.x, newYPosn), nsIScrollableFrame::INSTANT); } return NS_OK; } /* readonly attribute nsIPrintSettings globalPrintSettings; */ NS_IMETHODIMP diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -256,17 +256,17 @@ GetScaleForValue(const nsStyleAnimation: } nsCSSValueList* values = aValue.GetCSSValueListValue(); if (values->mValue.GetUnit() == eCSSUnit_None) { // There is an animation, but no actual transform yet. return gfxSize(); } - nsRect frameBounds = aFrame->GetRect(); + nsRect frameBounds = aFrame->GetPhysicalRect(); bool dontCare; gfx3DMatrix transform = nsStyleTransformMatrix::ReadTransforms( aValue.GetCSSValueListValue(), aFrame->StyleContext(), aFrame->PresContext(), dontCare, frameBounds, aFrame->PresContext()->AppUnitsPerDevPixel()); gfxMatrix transform2d; @@ -442,17 +442,17 @@ nsLayoutUtils::UnionChildOverflow(nsIFra if (skip.Contains(childLists.CurrentID())) { continue; } nsFrameList children = childLists.CurrentList(); for (nsFrameList::Enumerator e(children); !e.AtEnd(); e.Next()) { nsIFrame* child = e.get(); nsOverflowAreas childOverflow = - child->GetOverflowAreas() + child->GetPosition(); + child->GetOverflowAreas() + child->GetPhysicalPosition(); aOverflowAreas.UnionWith(childOverflow); } } } static void DestroyViewID(void* aObject, nsIAtom* aPropertyName, void* aPropertyValue, void* aData) { @@ -1242,17 +1242,17 @@ nsLayoutUtils::GetScrolledRect(nsIFrame* x2 = aScrollPortSize.width; } // When the scrolled frame chooses a size larger than its available width (because // its padding alone is larger than the available width), we need to keep the // start-edge of the scroll frame anchored to the start-edge of the scrollport. // When the scrolled frame is RTL, this means moving it in our left-based // coordinate system, so we need to compensate for its extra width here by // effectively repositioning the frame. - nscoord extraWidth = std::max(0, aScrolledFrame->GetSize().width - aScrollPortSize.width); + nscoord extraWidth = std::max(0, aScrolledFrame->GetPhysicalSize().width - aScrollPortSize.width); x2 += extraWidth; } return nsRect(x1, y1, x2 - x1, y2 - y1); } //static bool nsLayoutUtils::HasPseudoStyle(nsIContent* aContent, @@ -1995,17 +1995,17 @@ nsLayoutUtils::PaintFrame(nsRenderingCon } // Windowed plugins aren't allowed in popups if ((aFlags & PAINT_WIDGET_LAYERS) && !willFlushRetainedLayers && !(aFlags & PAINT_DOCUMENT_RELATIVE) && rootPresContext->NeedToComputePluginGeometryUpdates()) { builder.SetWillComputePluginGeometry(true); } - nsRect canvasArea(nsPoint(0, 0), aFrame->GetSize()); + nsRect canvasArea(nsPoint(0, 0), aFrame->GetPhysicalSize()); if (ignoreViewportScrolling && rootScrollFrame) { nsIScrollableFrame* rootScrollableFrame = presShell->GetRootScrollFrameAsScrollable(); if (aFlags & PAINT_DOCUMENT_RELATIVE) { // Make visibleRegion and aRenderingContext relative to the // scrolled frame instead of the root frame. nsPoint pos = rootScrollableFrame->GetScrollPosition(); @@ -2049,17 +2049,17 @@ nsLayoutUtils::PaintFrame(nsRenderingCon } } // For the viewport frame in print preview/page layout we want to paint // the grey background behind the page, not the canvas color. if (frameType == nsGkAtoms::viewportFrame && nsLayoutUtils::NeedsPrintPreviewBackground(presContext)) { nsRect bounds = nsRect(builder.ToReferenceFrame(aFrame), - aFrame->GetSize()); + aFrame->GetPhysicalSize()); presShell->AddPrintPreviewBackgroundItem(builder, list, aFrame, bounds); } else if (frameType != nsGkAtoms::pageFrame) { // For printing, this function is first called on an nsPageFrame, which // creates a display list with a PageContent item. The PageContent item's // paint function calls this function on the nsPageFrame's child which is // an nsPageContentFrame. We only want to add the canvas background color // item once, for the nsPageContentFrame. @@ -2329,17 +2329,17 @@ struct BoxToRect : public nsLayoutUtils: } mCallback->AddRect(r); } }; static nsSize GetFrameBorderSize(nsIFrame* aFrame) { - return aFrame->GetSize(); + return aFrame->GetPhysicalSize(); } void nsLayoutUtils::GetAllInFlowRects(nsIFrame* aFrame, nsIFrame* aRelativeTo, RectCallback* aCallback, uint32_t aFlags) { BoxToRect converter(aRelativeTo, aCallback, aFlags, &GetFrameBorderSize); GetAllInFlowBoxes(aFrame, &converter); @@ -2650,17 +2650,17 @@ GetPercentHeight(const nsStyleCoord& aSt // so I'll choose not to. -LDB return false; } NS_ASSERTION(pos->mHeight.GetUnit() == eStyleUnit_Auto, "Unexpected height unit for viewport or canvas or page-content"); // For the viewport, canvas, and page-content kids, the percentage // basis is just the parent height. - h = f->GetSize().height; + h = f->GetPhysicalSize().height; if (h == NS_UNCONSTRAINEDSIZE) { // We don't have a percentage basis after all return false; } } nscoord maxh; if (GetAbsoluteCoord(pos->mMaxHeight, maxh) || @@ -3661,60 +3661,60 @@ nsLayoutUtils::GetFirstLinePosition(cons // For the first-line baseline we also have to check for a table, and if // so, use the baseline of its first row. nsIAtom* fType = aFrame->GetType(); if (fType == nsGkAtoms::tableOuterFrame) { aResult->mTop = 0; aResult->mBaseline = aFrame->GetBaseline(); // This is what we want for the list bullet caller; not sure if // other future callers will want the same. - aResult->mBottom = aFrame->GetSize().height; + aResult->mBottom = aFrame->GetPhysicalSize().height; return true; } // For first-line baselines, we have to consider scroll frames. if (fType == nsGkAtoms::scrollFrame) { nsIScrollableFrame *sFrame = do_QueryFrame(const_cast(aFrame)); if (!sFrame) { NS_NOTREACHED("not scroll frame"); } LinePosition kidPosition; if (GetFirstLinePosition(sFrame->GetScrolledFrame(), &kidPosition)) { // Consider only the border and padding that contributes to the // kid's position, not the scrolling, so we get the initial // position. - *aResult = kidPosition + aFrame->GetUsedBorderAndPadding().top; + *aResult = kidPosition + aFrame->GetUsedPhysicalBorderAndPadding().top; return true; } return false; } if (fType == nsGkAtoms::fieldSetFrame) { LinePosition kidPosition; nsIFrame* kid = aFrame->GetFirstPrincipalChild(); // kid might be a legend frame here, but that's ok. if (GetFirstLinePosition(kid, &kidPosition)) { - *aResult = kidPosition + kid->GetNormalPosition().y; + *aResult = kidPosition + kid->GetNormalPhysicalPosition().y; return true; } return false; } // No baseline. return false; } for (nsBlockFrame::const_line_iterator line = block->begin_lines(), line_end = block->end_lines(); line != line_end; ++line) { if (line->IsBlock()) { nsIFrame *kid = line->mFirstChild; LinePosition kidPosition; if (GetFirstLinePosition(kid, &kidPosition)) { - *aResult = kidPosition + kid->GetNormalPosition().y; + *aResult = kidPosition + kid->GetNormalPhysicalPosition().y; return true; } } else { // XXX Is this the right test? We have some bogus empty lines // floating around, but IsEmpty is perhaps too weak. if (line->GetHeight() != 0 || !line->IsEmpty()) { nscoord top = line->mBounds.y; aResult->mTop = top; @@ -3738,22 +3738,22 @@ nsLayoutUtils::GetLastLineBaseline(const for (nsBlockFrame::const_reverse_line_iterator line = block->rbegin_lines(), line_end = block->rend_lines(); line != line_end; ++line) { if (line->IsBlock()) { nsIFrame *kid = line->mFirstChild; nscoord kidBaseline; if (GetLastLineBaseline(kid, &kidBaseline)) { // Ignore relative positioning for baseline calculations - *aResult = kidBaseline + kid->GetNormalPosition().y; + *aResult = kidBaseline + kid->GetNormalPhysicalPosition().y; return true; } else if (kid->GetType() == nsGkAtoms::scrollFrame) { // Use the bottom of the scroll frame. // XXX CSS2.1 really doesn't say what to do here. - *aResult = kid->GetNormalPosition().y + kid->GetRect().height; + *aResult = kid->GetNormalPhysicalPosition().y + kid->GetPhysicalRect().height; return true; } } else { // XXX Is this the right test? We have some bogus empty lines // floating around, but IsEmpty is perhaps too weak. if (line->GetHeight() != 0 || !line->IsEmpty()) { *aResult = line->mBounds.y + line->GetAscent(); return true; @@ -3770,33 +3770,33 @@ CalculateBlockContentBottom(nsBlockFrame nscoord contentBottom = 0; for (nsBlockFrame::line_iterator line = aFrame->begin_lines(), line_end = aFrame->end_lines(); line != line_end; ++line) { if (line->IsBlock()) { nsIFrame* child = line->mFirstChild; - nscoord offset = child->GetNormalPosition().y; + nscoord offset = child->GetNormalPhysicalPosition().y; contentBottom = std::max(contentBottom, nsLayoutUtils::CalculateContentBottom(child) + offset); } else { contentBottom = std::max(contentBottom, line->mBounds.YMost()); } } return contentBottom; } /* static */ nscoord nsLayoutUtils::CalculateContentBottom(nsIFrame* aFrame) { NS_PRECONDITION(aFrame, "null ptr"); - nscoord contentBottom = aFrame->GetRect().height; + nscoord contentBottom = aFrame->GetPhysicalRect().height; // We want scrollable overflow rather than visual because this // calculation is intended to affect layout. if (aFrame->GetScrollableOverflowRect().height > contentBottom) { nsIFrame::ChildListIDs skip(nsIFrame::kOverflowList | nsIFrame::kExcessOverflowContainersList | nsIFrame::kOverflowOutOfFlowList); nsBlockFrame* blockFrame = GetAsBlock(aFrame); @@ -3806,17 +3806,17 @@ nsLayoutUtils::CalculateContentBottom(ns skip |= nsIFrame::kPrincipalList; } nsIFrame::ChildListIterator lists(aFrame); for (; !lists.IsDone(); lists.Next()) { if (!skip.Contains(lists.CurrentID())) { nsFrameList::Enumerator childFrames(lists.CurrentList()); for (; !childFrames.AtEnd(); childFrames.Next()) { nsIFrame* child = childFrames.get(); - nscoord offset = child->GetNormalPosition().y; + nscoord offset = child->GetNormalPhysicalPosition().y; contentBottom = std::max(contentBottom, CalculateContentBottom(child) + offset); } } } } return contentBottom; } diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -1853,17 +1853,17 @@ PresShell::ResizeReflowIgnoreOverride(ns DidDoReflow(true, false); } } rootFrame = mFrameConstructor->GetRootFrame(); if (aHeight == NS_UNCONSTRAINEDSIZE && rootFrame) { mPresContext->SetVisibleArea( - nsRect(0, 0, aWidth, rootFrame->GetRect().height)); + nsRect(0, 0, aWidth, rootFrame->GetPhysicalRect().height)); } if (!mIsDestroying && !mResizeEvent.IsPending() && !mAsyncResizeTimerIsActive) { if (mInResize) { if (!mAsyncResizeEventTimer) { mAsyncResizeEventTimer = do_CreateInstance("@mozilla.org/timer;1"); } @@ -2941,17 +2941,17 @@ AccumulateFrameBounds(nsIFrame* aContain bool aUseWholeLineHeightForInlines, nsRect& aRect, bool& aHaveRect, nsIFrame*& aPrevBlock, nsAutoLineIterator& aLines, int32_t& aCurLine) { nsIFrame* frame = aFrame; - nsRect frameBounds = nsRect(nsPoint(0, 0), aFrame->GetSize()); + nsRect frameBounds = nsRect(nsPoint(0, 0), aFrame->GetPhysicalSize()); // If this is an inline frame and either the bounds height is 0 (quirks // layout model) or aUseWholeLineHeightForInlines is set, we need to // change the top of the bounds to include the whole line. if (frameBounds.height == 0 || aUseWholeLineHeightForInlines) { nsIFrame *prevFrame = aFrame; nsIFrame *f = aFrame; @@ -3295,17 +3295,17 @@ PresShell::ScrollFrameRectIntoView(nsIFr nsRect rect = aRect; nsIFrame* container = aFrame; // Walk up the frame hierarchy scrolling the rect into view and // keeping rect relative to container do { nsIScrollableFrame* sf = do_QueryFrame(container); if (sf) { nsPoint oldPosition = sf->GetScrollPosition(); - ScrollToShowRect(container, sf, rect - sf->GetScrolledFrame()->GetPosition(), + ScrollToShowRect(container, sf, rect - sf->GetScrolledFrame()->GetPhysicalPosition(), aVertical, aHorizontal, aFlags); nsPoint newPosition = sf->GetScrollPosition(); // If the scroll position increased, that means our content moved up, // so our rect's offset should decrease rect += oldPosition - newPosition; if (oldPosition != newPosition) { didScroll = true; @@ -3316,17 +3316,17 @@ PresShell::ScrollFrameRectIntoView(nsIFr break; } } nsIFrame* parent; if (container->IsTransformed()) { container->GetTransformMatrix(nullptr, &parent); rect = nsLayoutUtils::TransformFrameRectToAncestor(container, rect, parent); } else { - rect += container->GetPosition(); + rect += container->GetPhysicalPosition(); parent = container->GetParent(); } if (!parent && !(aFlags & nsIPresShell::SCROLL_NO_PARENT_FRAMES)) { nsPoint extraOffset(0,0); parent = nsLayoutUtils::GetCrossDocParentFrame(container, &extraOffset); if (parent) { int32_t APD = container->PresContext()->AppUnitsPerDevPixel(); int32_t parentAPD = parent->PresContext()->AppUnitsPerDevPixel(); @@ -3352,17 +3352,17 @@ PresShell::GetRectVisibility(nsIFrame* a "How can someone have a frame for this presshell when there's no root?"); nsIScrollableFrame* sf = GetRootScrollFrameAsScrollable(); nsRect scrollPortRect; if (sf) { scrollPortRect = sf->GetScrollPortRect(); nsIFrame* f = do_QueryFrame(sf); scrollPortRect += f->GetOffsetTo(rootFrame); } else { - scrollPortRect = nsRect(nsPoint(0,0), rootFrame->GetSize()); + scrollPortRect = nsRect(nsPoint(0,0), rootFrame->GetPhysicalSize()); } nsRect r = aRect + aFrame->GetOffsetTo(rootFrame); // If aRect is entirely visible then we don't need to ensure that // at least aMinTwips of it is visible if (scrollPortRect.Contains(r)) return nsRectVisibility_kVisible; @@ -4503,17 +4503,17 @@ PresShell::ClipListToRange(nsDisplayList nsPoint startPoint, endPoint; frame->GetPointFromOffset(hilightStart, &startPoint); frame->GetPointFromOffset(hilightEnd, &endPoint); // the clip rectangle is determined by taking the the start and // end points of the range, offset from the reference frame. // Because of rtl, the end point may be to the left of the // start point, so x is set to the lowest value - nsRect textRect(aBuilder->ToReferenceFrame(frame), frame->GetSize()); + nsRect textRect(aBuilder->ToReferenceFrame(frame), frame->GetPhysicalSize()); nscoord x = std::min(startPoint.x, endPoint.x); textRect.x += x; textRect.width = std::max(startPoint.x, endPoint.x) - x; surfaceRect.UnionRect(surfaceRect, textRect); DisplayItemClip newClip; newClip.SetTo(textRect); newClip.IntersectWith(i->GetClip()); @@ -5357,17 +5357,17 @@ PresShell::UpdateImageVisibility() nsIFrame* rootFrame = GetRootFrame(); if (!rootFrame) { ClearVisibleImagesList(); return; } // We could walk the frame tree directly and skip creating a display list for // better perf. - nsRect updateRect(nsPoint(0, 0), rootFrame->GetSize()); + nsRect updateRect(nsPoint(0, 0), rootFrame->GetPhysicalSize()); nsDisplayListBuilder builder(rootFrame, nsDisplayListBuilder::IMAGE_VISIBILITY, true); builder.IgnorePaintSuppression(); builder.EnterPresShell(rootFrame, updateRect); nsDisplayList list; rootFrame->BuildDisplayListForStackingContext(&builder, updateRect, &list); builder.LeavePresShell(rootFrame, updateRect); RebuildImageVisibility(list); @@ -5526,17 +5526,17 @@ public: nsRect bounds = mShell->GetPresContext()->GetVisibleArea(); builder.EnterPresShell(mFrame, bounds); mFrame->BuildDisplayListForStackingContext(&builder, bounds, &list); builder.LeavePresShell(mFrame, bounds); list.HitTest(&builder, bounds, &hitTestState, &outFrames); list.DeleteAll(); for (int32_t i = outFrames.Length() - 1; i >= 0; --i) { region.Or(region, nsLayoutUtils::TransformFrameRectToAncestor( - outFrames[i], nsRect(nsPoint(0, 0), outFrames[i]->GetSize()), mFrame)); + outFrames[i], nsRect(nsPoint(0, 0), outFrames[i]->GetPhysicalSize()), mFrame)); } tabChild->UpdateHitRegion(region); } private: PresShell* mShell; nsIFrame* mFrame; }; @@ -7329,17 +7329,17 @@ PresShell::GetCurrentItemAndPositionForE cols->GetFirstColumn(getter_AddRefs(col)); if (col) { nsCOMPtr colElement; col->GetElement(getter_AddRefs(colElement)); nsCOMPtr colContent(do_QueryInterface(colElement)); if (colContent) { nsIFrame* frame = colContent->GetPrimaryFrame(); if (frame) { - extraTreeY += frame->GetSize().height; + extraTreeY += frame->GetPhysicalSize().height; } } } } } else { multiSelect->GetCurrentItem(getter_AddRefs(item)); } @@ -7384,17 +7384,17 @@ PresShell::GetCurrentItemAndPositionForE // menu away from the top left corner of the frame. If we always // used the frame height, the context menu could end up far away, // for example when we're focused on linked images. // On the other hand, we want to use the frame height if it's less // than the current line height, so that the context menu appears // associated with the correct frame. nscoord extra = 0; if (!istree) { - extra = frame->GetSize().height; + extra = frame->GetPhysicalSize().height; if (checkLineHeight) { nsIScrollableFrame *scrollFrame = nsLayoutUtils::GetNearestScrollableFrame(frame); if (scrollFrame) { nsSize scrollAmount = scrollFrame->GetLineScrollAmount(); nsIFrame* f = do_QueryFrame(scrollFrame); int32_t APD = presContext->AppUnitsPerDevPixel(); int32_t scrollAPD = f->PresContext()->AppUnitsPerDevPixel(); @@ -7847,17 +7847,17 @@ PresShell::DoReflow(nsIFrame* target, bo // If the target frame is the root of the frame hierarchy, then // use all the available space. If it's simply a `reflow root', // then use the target frame's size as the available space. nsSize size; if (target == rootFrame) { size = mPresContext->GetVisibleArea().Size(); } else { - size = target->GetSize(); + size = target->GetPhysicalSize(); } NS_ASSERTION(!target->GetNextInFlow() && !target->GetPrevInFlow(), "reflow roots should never split"); // Don't pass size directly to the reflow state, since a // constrained height implies page/column breaking. nsSize reflowSize(size.width, NS_UNCONSTRAINEDSIZE); @@ -8420,19 +8420,19 @@ CompareTrees(nsPresContext* aFirstPresCo if (((nullptr == k1) && (nullptr != k2)) || ((nullptr != k1) && (nullptr == k2))) { ok = false; LogVerifyMessage(k1, k2, "child lists are different\n"); break; } else if (nullptr != k1) { // Verify that the frames are the same size - if (!k1->GetRect().IsEqualInterior(k2->GetRect())) { + if (!k1->GetPhysicalRect().IsEqualInterior(k2->GetPhysicalRect())) { ok = false; - LogVerifyMessage(k1, k2, "(frame rects)", k1->GetRect(), k2->GetRect()); + LogVerifyMessage(k1, k2, "(frame rects)", k1->GetPhysicalRect(), k2->GetPhysicalRect()); } // Make sure either both have views or neither have views; if they // do have views, make sure the views are the same size. If the // views have widgets, make sure they both do or neither does. If // they do, make sure the widgets are the same size. v1 = k1->GetView(); v2 = k2->GetView(); diff --git a/layout/forms/nsButtonFrameRenderer.cpp b/layout/forms/nsButtonFrameRenderer.cpp --- a/layout/forms/nsButtonFrameRenderer.cpp +++ b/layout/forms/nsButtonFrameRenderer.cpp @@ -84,17 +84,17 @@ nsRect nsDisplayButtonBoxShadowOuter::GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap) { *aSnap = false; return mFrame->GetVisualOverflowRectRelativeToSelf() + ToReferenceFrame(); } void nsDisplayButtonBoxShadowOuter::Paint(nsDisplayListBuilder* aBuilder, nsRenderingContext* aCtx) { - nsRect frameRect = nsRect(ToReferenceFrame(), mFrame->GetSize()); + nsRect frameRect = nsRect(ToReferenceFrame(), mFrame->GetPhysicalSize()); nsRect buttonRect; mBFR->GetButtonRect(frameRect, buttonRect); nsCSSRendering::PaintBoxShadowOuter(mFrame->PresContext(), *aCtx, mFrame, buttonRect, mVisibleRect); } @@ -124,17 +124,17 @@ public: NS_DISPLAY_DECL_NAME("ButtonBorderBackground", TYPE_BUTTON_BORDER_BACKGROUND) private: nsButtonFrameRenderer* mBFR; }; nsRect nsDisplayButtonBorderBackground::GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap) { *aSnap = false; - return aBuilder->IsForEventDelivery() ? nsRect(ToReferenceFrame(), mFrame->GetSize()) + return aBuilder->IsForEventDelivery() ? nsRect(ToReferenceFrame(), mFrame->GetPhysicalSize()) : mFrame->GetVisualOverflowRectRelativeToSelf() + ToReferenceFrame(); } class nsDisplayButtonForeground : public nsDisplayItem { public: nsDisplayButtonForeground(nsDisplayListBuilder* aBuilder, nsButtonFrameRenderer* aRenderer) : nsDisplayItem(aBuilder, aRenderer->GetFrame()), mBFR(aRenderer) { @@ -163,32 +163,32 @@ nsDisplayButtonBorderBackground::Compute nsDisplayItem::ComputeInvalidationRegion(aBuilder, aGeometry, aInvalidRegion); } void nsDisplayButtonBorderBackground::Paint(nsDisplayListBuilder* aBuilder, nsRenderingContext* aCtx) { NS_ASSERTION(mFrame, "No frame?"); nsPresContext* pc = mFrame->PresContext(); - nsRect r = nsRect(ToReferenceFrame(), mFrame->GetSize()); + nsRect r = nsRect(ToReferenceFrame(), mFrame->GetPhysicalSize()); // draw the border and background inside the focus and outline borders mBFR->PaintBorderAndBackground(pc, *aCtx, mVisibleRect, r, aBuilder->GetBackgroundPaintFlags()); } void nsDisplayButtonForeground::Paint(nsDisplayListBuilder* aBuilder, nsRenderingContext* aCtx) { nsPresContext *presContext = mFrame->PresContext(); const nsStyleDisplay *disp = mFrame->StyleDisplay(); if (!mFrame->IsThemed(disp) || !presContext->GetTheme()->ThemeDrawsFocusForWidget(disp->mAppearance)) { // draw the focus and outline borders - nsRect r = nsRect(ToReferenceFrame(), mFrame->GetSize()); + nsRect r = nsRect(ToReferenceFrame(), mFrame->GetPhysicalSize()); mBFR->PaintOutlineAndFocusBorders(presContext, *aCtx, mVisibleRect, r); } } nsresult nsButtonFrameRenderer::DisplayButton(nsDisplayListBuilder* aBuilder, nsDisplayList* aBackground, nsDisplayList* aForeground) @@ -307,17 +307,17 @@ nsButtonFrameRenderer::GetButtonOuterFoc } return result; } nsMargin nsButtonFrameRenderer::GetButtonBorderAndPadding() { - return mFrame->GetUsedBorderAndPadding(); + return mFrame->GetUsedPhysicalBorderAndPadding(); } /** * Gets the size of the buttons border this is the union of the normal and disabled borders. */ nsMargin nsButtonFrameRenderer::GetButtonInnerFocusMargin() { diff --git a/layout/forms/nsComboboxControlFrame.cpp b/layout/forms/nsComboboxControlFrame.cpp --- a/layout/forms/nsComboboxControlFrame.cpp +++ b/layout/forms/nsComboboxControlFrame.cpp @@ -283,17 +283,17 @@ nsComboboxControlFrame::SetFocus(bool aO void nsComboboxControlFrame::ShowPopup(bool aShowPopup) { nsView* view = mDropdownFrame->GetView(); nsViewManager* viewManager = view->GetViewManager(); if (aShowPopup) { - nsRect rect = mDropdownFrame->GetRect(); + nsRect rect = mDropdownFrame->GetPhysicalRect(); rect.x = rect.y = 0; viewManager->ResizeView(view, rect); viewManager->SetViewVisibility(view, nsViewVisibility_kShow); } else { viewManager->SetViewVisibility(view, nsViewVisibility_kHide); nsRect emptyRect(0, 0, 0, 0); viewManager->ResizeView(view, emptyRect); } @@ -433,17 +433,17 @@ nsComboboxControlFrame::ReflowDropdown(n } // Allow the child to move/size/change-visibility its view if it's currently // dropped down int32_t flags = NS_FRAME_NO_MOVE_FRAME | NS_FRAME_NO_VISIBILITY | NS_FRAME_NO_SIZE_VIEW; if (mDroppedDown) { flags = 0; } - nsRect rect = mDropdownFrame->GetRect(); + nsRect rect = mDropdownFrame->GetPhysicalRect(); nsHTMLReflowMetrics desiredSize; nsReflowStatus ignoredStatus; nsresult rv = ReflowChild(mDropdownFrame, aPresContext, desiredSize, kidReflowState, rect.x, rect.y, flags, ignoredStatus); // Set the child's width and height to it's desired size FinishReflowChild(mDropdownFrame, aPresContext, &kidReflowState, @@ -602,17 +602,17 @@ nsComboboxControlFrame::AbsolutelyPositi // Hide the view immediately to minimize flicker. nsView* view = mDropdownFrame->GetView(); view->GetViewManager()->SetViewVisibility(view, nsViewVisibility_kHide); NS_DispatchToCurrentThread(new nsAsyncRollup(this)); } return eDropDownPositionSuppressed; } - nsSize dropdownSize = mDropdownFrame->GetSize(); + nsSize dropdownSize = mDropdownFrame->GetPhysicalSize(); nscoord height = std::max(above, below); nsListControlFrame* lcf = static_cast(mDropdownFrame); if (height < dropdownSize.height) { if (lcf->GetNumDisplayRows() > 1) { // The drop-down doesn't fit and currently shows more than 1 row - // schedule a resize to show fewer rows. NS_DispatchToCurrentThread(new nsAsyncResize(this)); return eDropDownPositionPendingResize; @@ -626,25 +626,25 @@ nsComboboxControlFrame::AbsolutelyPositi NS_DispatchToCurrentThread(new nsAsyncResize(this)); return eDropDownPositionPendingResize; } // Position the drop-down below if there is room, otherwise place it above // if there is room. If there is no room for it on either side then place // it below (to avoid overlapping UI like the URL bar). bool b = dropdownSize.height <= below || dropdownSize.height > above; - nsPoint dropdownPosition(0, b ? GetRect().height : -dropdownSize.height); + nsPoint dropdownPosition(0, b ? GetPhysicalRect().height : -dropdownSize.height); if (StyleVisibility()->mDirection == NS_STYLE_DIRECTION_RTL) { // Align the right edge of the drop-down with the right edge of the control. - dropdownPosition.x = GetRect().width - dropdownSize.width; + dropdownPosition.x = GetPhysicalRect().width - dropdownSize.width; } // Don't position the view unless the position changed since it might cause // a call to NotifyGeometryChange() and an infinite loop here. - const nsPoint currentPos = mDropdownFrame->GetPosition(); + const nsPoint currentPos = mDropdownFrame->GetPhysicalPosition(); const nsPoint newPos = dropdownPosition + translation; if (currentPos != newPos) { mDropdownFrame->SetPosition(newPos); nsContainerFrame::PositionFrameView(mDropdownFrame); } return eDropDownPositionFinal; } @@ -826,40 +826,40 @@ nsComboboxControlFrame::Reflow(nsPresCon mDisplayWidth = aReflowState.ComputedWidth() - buttonWidth; nsresult rv = nsBlockFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus); NS_ENSURE_SUCCESS(rv, rv); // Now set the correct width and height on our button. The width we need to // set always, the height only if we had an auto height. - nsRect buttonRect = mButtonFrame->GetRect(); + nsRect buttonRect = mButtonFrame->GetPhysicalRect(); // If we have a non-intrinsic computed height, our kids should have sized // themselves properly on their own. if (aReflowState.ComputedHeight() == NS_INTRINSICSIZE) { // The display frame is going to be the right height and width at this // point. Use its height as the button height. - nsRect displayRect = mDisplayFrame->GetRect(); + nsRect displayRect = mDisplayFrame->GetPhysicalRect(); buttonRect.height = displayRect.height; buttonRect.y = displayRect.y; } #ifdef DEBUG else { - nscoord buttonHeight = mButtonFrame->GetSize().height; - nscoord displayHeight = mDisplayFrame->GetSize().height; + nscoord buttonHeight = mButtonFrame->GetPhysicalSize().height; + nscoord displayHeight = mDisplayFrame->GetPhysicalSize().height; // The button and display area should be equal heights, unless the computed // height on the combobox is too small to fit their borders and padding. NS_ASSERTION(buttonHeight == displayHeight || (aReflowState.ComputedHeight() < buttonHeight && buttonHeight == - mButtonFrame->GetUsedBorderAndPadding().TopBottom()) || + mButtonFrame->GetUsedPhysicalBorderAndPadding().TopBottom()) || (aReflowState.ComputedHeight() < displayHeight && displayHeight == - mDisplayFrame->GetUsedBorderAndPadding().TopBottom()), + mDisplayFrame->GetUsedPhysicalBorderAndPadding().TopBottom()), "Different heights?"); } #endif if (StyleVisibility()->mDirection == NS_STYLE_DIRECTION_RTL) { // Make sure the right edge of the button frame stays where it is now buttonRect.x -= buttonWidth - buttonRect.width; } @@ -1503,17 +1503,17 @@ void nsComboboxControlFrame::PaintFocus( nsPoint aPt) { /* Do we need to do anything? */ nsEventStates eventStates = mContent->AsElement()->State(); if (eventStates.HasState(NS_EVENT_STATE_DISABLED) || sFocused != this) return; aRenderingContext.PushState(); - nsRect clipRect = mDisplayFrame->GetRect() + aPt; + nsRect clipRect = mDisplayFrame->GetPhysicalRect() + aPt; aRenderingContext.IntersectClip(clipRect); // REVIEW: Why does the old code paint mDisplayFrame again? We've // already painted it in the children above. So clipping it here won't do // us much good. ///////////////////// // draw focus diff --git a/layout/forms/nsFieldSetFrame.cpp b/layout/forms/nsFieldSetFrame.cpp --- a/layout/forms/nsFieldSetFrame.cpp +++ b/layout/forms/nsFieldSetFrame.cpp @@ -38,17 +38,17 @@ public: virtual nscoord GetBaseline() const; /** * The area to paint box-shadows around. It's the border rect except * when there's a we offset the y-position to the center of it. */ virtual nsRect VisualBorderRectRelativeToSelf() const MOZ_OVERRIDE { nscoord topBorder = StyleBorder()->GetComputedBorderWidth(NS_SIDE_TOP); - nsRect r(nsPoint(0,0), GetSize()); + nsRect r(nsPoint(0,0), GetPhysicalSize()); if (topBorder < mLegendRect.height) { nscoord yoff = (mLegendRect.height - topBorder) / 2; r.y += yoff; r.height -= yoff; } return r; } @@ -287,17 +287,17 @@ nsFieldSetFrame::PaintBorderBackground(n nsCSSRendering::PaintBoxShadowInner(presContext, aRenderingContext, this, rect, aDirtyRect); if (nsIFrame* legend = GetLegend()) { nscoord topBorder = StyleBorder()->GetComputedBorderWidth(NS_SIDE_TOP); // Use the rect of the legend frame, not mLegendRect, so we draw our // border under the legend's left and right margins. - nsRect legendRect = legend->GetRect() + aPt; + nsRect legendRect = legend->GetPhysicalRect() + aPt; // we should probably use PaintBorderEdges to do this but for now just use clipping // to achieve the same effect. // draw left side nsRect clipRect(rect); clipRect.width = legendRect.x - rect.x; clipRect.height = topBorder; @@ -473,17 +473,17 @@ nsFieldSetFrame::Reflow(nsPresContext* nsHTMLReflowMetrics legendDesiredSize; ReflowChild(legend, aPresContext, legendDesiredSize, legendReflowState, 0, 0, NS_FRAME_NO_MOVE_FRAME, aStatus); #ifdef NOISY_REFLOW printf(" returned (%d, %d)\n", legendDesiredSize.width, legendDesiredSize.height); #endif // figure out the legend's rectangle - legendMargin = legend->GetUsedMargin(); + legendMargin = legend->GetUsedPhysicalMargin(); mLegendRect.width = legendDesiredSize.width + legendMargin.left + legendMargin.right; mLegendRect.height = legendDesiredSize.height + legendMargin.top + legendMargin.bottom; mLegendRect.x = borderPadding.left; mLegendRect.y = 0; nscoord oldSpace = mLegendSpace; mLegendSpace = 0; if (mLegendRect.height > border.top) { @@ -502,17 +502,17 @@ nsFieldSetFrame::Reflow(nsPresContext* FinishReflowChild(legend, aPresContext, &legendReflowState, legendDesiredSize, 0, 0, NS_FRAME_NO_MOVE_FRAME); } else if (!legend) { mLegendRect.SetEmpty(); mLegendSpace = 0; } else { // mLegendSpace and mLegendRect haven't changed, but we need // the used margin when placing the legend. - legendMargin = legend->GetUsedMargin(); + legendMargin = legend->GetUsedPhysicalMargin(); } // reflow the content frame only if needed if (reflowInner) { nsHTMLReflowState kidReflowState(aPresContext, aReflowState, inner, availSize); // Our child is "height:100%" but we actually want its height to be reduced // by the amount of content-height the legend is eating up, unless our @@ -541,17 +541,17 @@ nsFieldSetFrame::Reflow(nsPresContext* kidDesiredSize, pt.x, pt.y, 0); NS_FRAME_TRACE_REFLOW_OUT("FieldSet::Reflow", aStatus); } nsRect contentRect(0,0,0,0); if (inner) { // We don't support margins on inner, so our "content rect" is just // its rect. - contentRect = inner->GetRect(); + contentRect = inner->GetPhysicalRect(); } // use the computed width if the inner content does not fill it if (aReflowState.ComputedWidth() > contentRect.width) { contentRect.width = aReflowState.ComputedWidth(); } if (legend) { @@ -573,17 +573,17 @@ nsFieldSetFrame::Reflow(nsPresContext* } else { // otherwise make place for the legend contentRect.width = mLegendRect.width; } // place the legend nsRect actualLegendRect(mLegendRect); actualLegendRect.Deflate(legendMargin); - nsPoint curOrigin = legend->GetPosition(); + nsPoint curOrigin = legend->GetPhysicalPosition(); // only if the origin changed if ((curOrigin.x != actualLegendRect.x) || (curOrigin.y != actualLegendRect.y)) { legend->SetPosition(nsPoint(actualLegendRect.x , actualLegendRect.y)); nsContainerFrame::PositionFrameView(legend); // We need to recursively process the legend frame's // children since we're moving the frame after Reflow. @@ -680,10 +680,10 @@ nsFieldSetFrame::ReparentFrameList(const nscoord nsFieldSetFrame::GetBaseline() const { // We know inner is a block, so calling GetBaseline() on it will do // the right thing (that being to return the baseline of the last line). nsIFrame* inner = GetInner(); NS_ASSERTION(nsLayoutUtils::GetAsBlock(inner), "Unexpected inner"); - return inner->GetPosition().y + inner->GetBaseline(); + return inner->GetPhysicalPosition().y + inner->GetBaseline(); } diff --git a/layout/forms/nsFormControlFrame.cpp b/layout/forms/nsFormControlFrame.cpp --- a/layout/forms/nsFormControlFrame.cpp +++ b/layout/forms/nsFormControlFrame.cpp @@ -65,17 +65,17 @@ nsFormControlFrame::GetIntrinsicHeight() nscoord nsFormControlFrame::GetBaseline() const { NS_ASSERTION(!NS_SUBTREE_DIRTY(this), "frame must not be dirty"); // Treat radio buttons and checkboxes as having an intrinsic baseline // at the bottom of the control (use the bottom content edge rather // than the bottom margin edge). - return mRect.height - GetUsedBorderAndPadding().bottom; + return mRect.height - GetUsedPhysicalBorderAndPadding().bottom; } NS_METHOD nsFormControlFrame::Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus) { diff --git a/layout/forms/nsGfxCheckboxControlFrame.cpp b/layout/forms/nsGfxCheckboxControlFrame.cpp --- a/layout/forms/nsGfxCheckboxControlFrame.cpp +++ b/layout/forms/nsGfxCheckboxControlFrame.cpp @@ -14,18 +14,18 @@ using namespace mozilla; static void PaintCheckMark(nsIFrame* aFrame, nsRenderingContext* aCtx, const nsRect& aDirtyRect, nsPoint aPt) { - nsRect rect(aPt, aFrame->GetSize()); - rect.Deflate(aFrame->GetUsedBorderAndPadding()); + nsRect rect(aPt, aFrame->GetPhysicalSize()); + rect.Deflate(aFrame->GetUsedPhysicalBorderAndPadding()); // Points come from the coordinates on a 7X7 unit box centered at 0,0 const int32_t checkPolygonX[] = { -3, -1, 3, 3, -1, -3 }; const int32_t checkPolygonY[] = { -1, 1, -3, -1, 3, 1 }; const int32_t checkNumPoints = sizeof(checkPolygonX) / sizeof(int32_t); const int32_t checkSize = 9; // 2 units of padding on either side // of the 7x7 unit checkmark @@ -47,18 +47,18 @@ PaintCheckMark(nsIFrame* aFrame, } static void PaintIndeterminateMark(nsIFrame* aFrame, nsRenderingContext* aCtx, const nsRect& aDirtyRect, nsPoint aPt) { - nsRect rect(aPt, aFrame->GetSize()); - rect.Deflate(aFrame->GetUsedBorderAndPadding()); + nsRect rect(aPt, aFrame->GetPhysicalSize()); + rect.Deflate(aFrame->GetUsedPhysicalBorderAndPadding()); rect.y += (rect.height - rect.height/4) / 2; rect.height /= 4; aCtx->SetColor(aFrame->StyleColor()->mColor); aCtx->FillRect(rect); } diff --git a/layout/forms/nsGfxRadioControlFrame.cpp b/layout/forms/nsGfxRadioControlFrame.cpp --- a/layout/forms/nsGfxRadioControlFrame.cpp +++ b/layout/forms/nsGfxRadioControlFrame.cpp @@ -39,18 +39,18 @@ nsGfxRadioControlFrame::AccessibleType() static void PaintCheckedRadioButton(nsIFrame* aFrame, nsRenderingContext* aCtx, const nsRect& aDirtyRect, nsPoint aPt) { // The dot is an ellipse 2px on all sides smaller than the content-box, // drawn in the foreground color. - nsRect rect(aPt, aFrame->GetSize()); - rect.Deflate(aFrame->GetUsedBorderAndPadding()); + nsRect rect(aPt, aFrame->GetPhysicalSize()); + rect.Deflate(aFrame->GetUsedPhysicalBorderAndPadding()); rect.Deflate(nsPresContext::CSSPixelsToAppUnits(2), nsPresContext::CSSPixelsToAppUnits(2)); aCtx->SetColor(aFrame->StyleColor()->mColor); aCtx->FillEllipse(rect); } void diff --git a/layout/forms/nsHTMLButtonControlFrame.cpp b/layout/forms/nsHTMLButtonControlFrame.cpp --- a/layout/forms/nsHTMLButtonControlFrame.cpp +++ b/layout/forms/nsHTMLButtonControlFrame.cpp @@ -104,17 +104,17 @@ nsHTMLButtonControlFrame::BuildDisplayLi nsDisplayListCollection set; // Do not allow the child subtree to receive events. if (!aBuilder->IsForEventDelivery()) { DisplayListClipState::AutoSaveRestore clipState(aBuilder); if (IsInput() || StyleDisplay()->mOverflowX != NS_STYLE_OVERFLOW_VISIBLE) { nsMargin border = StyleBorder()->GetComputedBorder(); - nsRect rect(aBuilder->ToReferenceFrame(this), GetSize()); + nsRect rect(aBuilder->ToReferenceFrame(this), GetPhysicalSize()); rect.Deflate(border); nscoord radii[8]; bool hasRadii = GetPaddingBoxBorderRadii(radii); clipState.ClipContainingBlockDescendants(rect, hasRadii ? radii : nullptr); } BuildDisplayListForChild(aBuilder, mFrames.FirstChild(), aDirtyRect, set, DISPLAY_CHILD_FORCE_PSEUDO_STACKING_CONTEXT); diff --git a/layout/forms/nsListControlFrame.cpp b/layout/forms/nsListControlFrame.cpp --- a/layout/forms/nsListControlFrame.cpp +++ b/layout/forms/nsListControlFrame.cpp @@ -158,17 +158,17 @@ nsListControlFrame::BuildDisplayList(nsD if (IsInDropDownMode()) { NS_ASSERTION(NS_GET_A(mLastDropdownBackstopColor) == 255, "need an opaque backstop color"); // XXX Because we have an opaque widget and we get called to paint with // this frame as the root of a stacking context we need make sure to draw // some opaque color over the whole widget. (Bug 511323) aLists.BorderBackground()->AppendNewToBottom( new (aBuilder) nsDisplaySolidColor(aBuilder, - this, nsRect(aBuilder->ToReferenceFrame(this), GetSize()), + this, nsRect(aBuilder->ToReferenceFrame(this), GetPhysicalSize()), mLastDropdownBackstopColor)); } nsHTMLScrollFrame::BuildDisplayList(aBuilder, aDirtyRect, aLists); } /** * This is called by the SelectsAreaFrame, which is the same @@ -190,17 +190,17 @@ void nsListControlFrame::PaintFocus(nsRe nsCOMPtr focusedContent = GetCurrentOption(); if (focusedContent) { childframe = focusedContent->GetPrimaryFrame(); } nsRect fRect; if (childframe) { // get the child rect - fRect = childframe->GetRect(); + fRect = childframe->GetPhysicalRect(); // get it into our coordinates fRect.MoveBy(childframe->GetParent()->GetOffsetTo(this)); } else { float inflation = nsLayoutUtils::FontSizeInflationFor(this); fRect.x = fRect.y = 0; fRect.width = GetScrollPortRect().width; fRect.height = CalcFallbackRowHeight(inflation); fRect.MoveBy(containerFrame->GetOffsetTo(this)); @@ -259,17 +259,17 @@ GetMaxOptionHeight(nsIFrame* aContainer) option; option = option->GetNextSibling()) { nscoord optionHeight; if (nsCOMPtr (do_QueryInterface(option->GetContent()))) { // an optgroup optionHeight = GetMaxOptionHeight(option); } else { // an option - optionHeight = option->GetSize().height; + optionHeight = option->GetPhysicalSize().height; } if (result < optionHeight) result = optionHeight; } return result; } //----------------------------------------------------------------- @@ -471,17 +471,17 @@ nsListControlFrame::ReflowAsDropdown(nsP "We should not have a computed height here!"); mMightNeedSecondPass = NS_SUBTREE_DIRTY(this) || aReflowState.ShouldReflowAllKids(); #ifdef DEBUG nscoord oldHeightOfARow = HeightOfARow(); nscoord oldVisibleHeight = (GetStateBits() & NS_FRAME_FIRST_REFLOW) ? - NS_UNCONSTRAINEDSIZE : GetScrolledFrame()->GetSize().height; + NS_UNCONSTRAINEDSIZE : GetScrolledFrame()->GetPhysicalSize().height; #endif nsHTMLReflowState state(aReflowState); if (!(GetStateBits() & NS_FRAME_FIRST_REFLOW)) { // When not doing an initial reflow, and when the height is auto, start off // with our computed height set to what we'd expect our height to be. // Note: At this point, mLastDropdownComputedHeight can be @@ -490,17 +490,17 @@ nsListControlFrame::ReflowAsDropdown(nsP state.SetComputedHeight(mLastDropdownComputedHeight); } nsresult rv = nsHTMLScrollFrame::Reflow(aPresContext, aDesiredSize, state, aStatus); NS_ENSURE_SUCCESS(rv, rv); if (!mMightNeedSecondPass) { - NS_ASSERTION(oldVisibleHeight == GetScrolledFrame()->GetSize().height, + NS_ASSERTION(oldVisibleHeight == GetScrolledFrame()->GetPhysicalSize().height, "How did our kid's height change if nothing was dirty?"); NS_ASSERTION(HeightOfARow() == oldHeightOfARow, "How did our height of a row change if nothing was dirty?"); NS_ASSERTION(!IsScrollbarUpdateSuppressed(), "Shouldn't be suppressing if we don't need a second pass!"); NS_ASSERTION(!(GetStateBits() & NS_FRAME_FIRST_REFLOW), "How can we avoid a second pass during first reflow?"); return rv; @@ -514,17 +514,17 @@ nsListControlFrame::ReflowAsDropdown(nsP // All done. No need to do more reflow. NS_ASSERTION(!(GetStateBits() & NS_FRAME_FIRST_REFLOW), "How can we avoid a second pass during first reflow?"); return rv; } SetSuppressScrollbarUpdate(false); - nscoord visibleHeight = GetScrolledFrame()->GetSize().height; + nscoord visibleHeight = GetScrolledFrame()->GetPhysicalSize().height; nscoord heightOfARow = HeightOfARow(); // Gotta reflow again. // XXXbz We're just changing the height here; do we need to dirty ourselves // or anything like that? We might need to, per the letter of the reflow // protocol, but things seem to work fine without it... Is that just an // implementation detail of nsHTMLScrollFrame that we're depending on? nsHTMLScrollFrame::DidReflow(aPresContext, &state, @@ -1725,31 +1725,31 @@ nsListControlFrame::GetIndexFromDOMEvent // If the event coordinate is above the first option frame, then target the // first option frame nsRefPtr firstOption = GetOption(0); NS_ASSERTION(firstOption, "Can't find first option that's supposed to be there"); nsIFrame* optionFrame = firstOption->GetPrimaryFrame(); if (optionFrame) { nsPoint ptInOptionFrame = pt - optionFrame->GetOffsetTo(this); if (ptInOptionFrame.y < 0 && ptInOptionFrame.x >= 0 && - ptInOptionFrame.x < optionFrame->GetSize().width) { + ptInOptionFrame.x < optionFrame->GetPhysicalSize().width) { aCurIndex = 0; return NS_OK; } } nsRefPtr lastOption = GetOption(numOptions - 1); // If the event coordinate is below the last option frame, then target the // last option frame NS_ASSERTION(lastOption, "Can't find last option that's supposed to be there"); optionFrame = lastOption->GetPrimaryFrame(); if (optionFrame) { nsPoint ptInOptionFrame = pt - optionFrame->GetOffsetTo(this); - if (ptInOptionFrame.y >= optionFrame->GetSize().height && ptInOptionFrame.x >= 0 && - ptInOptionFrame.x < optionFrame->GetSize().width) { + if (ptInOptionFrame.y >= optionFrame->GetPhysicalSize().height && ptInOptionFrame.x >= 0 && + ptInOptionFrame.x < optionFrame->GetPhysicalSize().width) { aCurIndex = numOptions - 1; return NS_OK; } } return NS_ERROR_FAILURE; } @@ -1914,17 +1914,17 @@ nsListControlFrame::ScrollToIndex(int32_ void nsListControlFrame::ScrollToFrame(dom::HTMLOptionElement& aOptElement) { // otherwise we find the content's frame and scroll to it nsIFrame* childFrame = aOptElement.GetPrimaryFrame(); if (childFrame) { PresContext()->PresShell()-> ScrollFrameRectIntoView(childFrame, - nsRect(nsPoint(0, 0), childFrame->GetSize()), + nsRect(nsPoint(0, 0), childFrame->GetPhysicalSize()), nsIPresShell::ScrollAxis(), nsIPresShell::ScrollAxis(), nsIPresShell::SCROLL_OVERFLOW_HIDDEN | nsIPresShell::SCROLL_FIRST_ANCESTOR_ONLY); } } //--------------------------------------------------------------------- // Ok, the entire idea of this routine is to move to the next item that diff --git a/layout/forms/nsRangeFrame.cpp b/layout/forms/nsRangeFrame.cpp --- a/layout/forms/nsRangeFrame.cpp +++ b/layout/forms/nsRangeFrame.cpp @@ -175,17 +175,17 @@ public: void nsDisplayRangeFocusRing::Paint(nsDisplayListBuilder* aBuilder, nsRenderingContext* aCtx) { nsPresContext *presContext = mFrame->PresContext(); nscoord appUnitsPerDevPixel = presContext->DevPixelsToAppUnits(1); gfxContext* ctx = aCtx->ThebesContext(); - nsRect r = nsRect(ToReferenceFrame(), mFrame->GetSize()); + nsRect r = nsRect(ToReferenceFrame(), mFrame->GetPhysicalSize()); gfxRect pxRect(nsLayoutUtils::RectToGfxRect(r, appUnitsPerDevPixel)); uint8_t borderStyles[4] = { NS_STYLE_BORDER_STYLE_DOTTED, NS_STYLE_BORDER_STYLE_DOTTED, NS_STYLE_BORDER_STYLE_DOTTED, NS_STYLE_BORDER_STYLE_DOTTED }; gfxFloat borderWidths[4] = { 1, 1, 1, 1 }; gfxCornerSizes borderRadii(0); nscolor borderColors[4] = { NS_RGB(0, 0, 0), NS_RGB(0, 0, 0), @@ -505,17 +505,17 @@ nsRangeFrame::GetValueAtEventPoint(nsGUI GetMinimumWidgetSize(tmpCtx.get(), this, NS_THEME_RANGE_THUMB, &size, ¬UsedCanOverride); thumbSize.width = presContext->DevPixelsToAppUnits(size.width); thumbSize.height = presContext->DevPixelsToAppUnits(size.height); MOZ_ASSERT(thumbSize.width > 0 && thumbSize.height > 0); } else { nsIFrame* thumbFrame = mThumbDiv->GetPrimaryFrame(); if (thumbFrame) { // diplay:none? - thumbSize = thumbFrame->GetSize(); + thumbSize = thumbFrame->GetPhysicalSize(); } } Decimal fraction; if (IsHorizontal()) { nscoord traversableDistance = rangeContentRect.width - thumbSize.width; if (traversableDistance <= 0) { return minimum; @@ -551,20 +551,20 @@ nsRangeFrame::UpdateForValueChange() return; // we're going to be updated when we reflow } nsIFrame* rangeProgressFrame = mProgressDiv->GetPrimaryFrame(); nsIFrame* thumbFrame = mThumbDiv->GetPrimaryFrame(); if (!rangeProgressFrame && !thumbFrame) { return; // diplay:none? } if (rangeProgressFrame) { - DoUpdateRangeProgressFrame(rangeProgressFrame, GetSize()); + DoUpdateRangeProgressFrame(rangeProgressFrame, GetPhysicalSize()); } if (thumbFrame) { - DoUpdateThumbPosition(thumbFrame, GetSize()); + DoUpdateThumbPosition(thumbFrame, GetPhysicalSize()); } if (IsThemed()) { // We don't know the exact dimensions or location of the thumb when native // theming is applied, so we just repaint the entire range. InvalidateFrame(); } #ifdef ACCESSIBILITY @@ -586,24 +586,24 @@ nsRangeFrame::DoUpdateThumbPosition(nsIF // The idea here is that we want to position the thumb so that the center // of the thumb is on an imaginary line drawn from the middle of one edge // of the range frame's content box to the middle of the opposite edge of // its content box (the opposite edges being the left/right edge if the // range is horizontal, or else the top/bottom edges if the range is // vertical). How far along this line the center of the thumb is placed // depends on the value of the range. - nsMargin borderAndPadding = GetUsedBorderAndPadding(); + nsMargin borderAndPadding = GetUsedPhysicalBorderAndPadding(); nsPoint newPosition(borderAndPadding.left, borderAndPadding.top); nsSize rangeContentBoxSize(aRangeSize); rangeContentBoxSize.width -= borderAndPadding.LeftRight(); rangeContentBoxSize.height -= borderAndPadding.TopBottom(); - nsSize thumbSize = aThumbFrame->GetSize(); + nsSize thumbSize = aThumbFrame->GetPhysicalSize(); double fraction = GetValueAsFractionOfRange(); MOZ_ASSERT(fraction >= 0.0 && fraction <= 1.0); // We are called under Reflow, so we need to pass IsHorizontal a valid rect. nsSize frameSizeOverride(aRangeSize.width, aRangeSize.height); if (IsHorizontal(&frameSizeOverride)) { if (thumbSize.width < rangeContentBoxSize.width) { nscoord traversableDistance = @@ -636,18 +636,18 @@ nsRangeFrame::DoUpdateRangeProgressFrame // pseudo-element so that the center line running along its length is on the // corresponding center line of the nsRangeFrame's content box. In the other // dimension, we align the "start" edge of the ::-moz-range-progress // pseudo-element's border-box with the corresponding edge of the // nsRangeFrame's content box, and we size the progress element's border-box // to have a length of GetValueAsFractionOfRange() times the nsRangeFrame's // content-box size. - nsMargin borderAndPadding = GetUsedBorderAndPadding(); - nsSize progSize = aRangeProgressFrame->GetSize(); + nsMargin borderAndPadding = GetUsedPhysicalBorderAndPadding(); + nsSize progSize = aRangeProgressFrame->GetPhysicalSize(); nsRect progRect(borderAndPadding.left, borderAndPadding.top, progSize.width, progSize.height); nsSize rangeContentBoxSize(aRangeSize); rangeContentBoxSize.width -= borderAndPadding.LeftRight(); rangeContentBoxSize.height -= borderAndPadding.TopBottom(); double fraction = GetValueAsFractionOfRange(); diff --git a/layout/forms/nsSelectsAreaFrame.cpp b/layout/forms/nsSelectsAreaFrame.cpp --- a/layout/forms/nsSelectsAreaFrame.cpp +++ b/layout/forms/nsSelectsAreaFrame.cpp @@ -166,17 +166,17 @@ nsSelectsAreaFrame::Reflow(nsPresContext // See similar logic in nsListControlFrame::Reflow and // nsListControlFrame::ReflowAsDropdown. We need to match it here. nscoord oldHeight; if (isInDropdownMode) { // Store the height now in case it changes during // nsBlockFrame::Reflow for some odd reason. if (!(GetStateBits() & NS_FRAME_FIRST_REFLOW)) { - oldHeight = GetSize().height; + oldHeight = GetPhysicalSize().height; } else { oldHeight = NS_UNCONSTRAINEDSIZE; } } nsresult rv = nsBlockFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus); NS_ENSURE_SUCCESS(rv, rv); @@ -185,16 +185,16 @@ nsSelectsAreaFrame::Reflow(nsPresContext // we're in a possible first pass and our height of a row has changed. if (list->MightNeedSecondPass()) { nscoord newHeightOfARow = list->CalcHeightOfARow(); // We'll need a second pass if our height of a row changed. For // comboboxes, we'll also need it if our height changed. If we're going // to do a second pass, suppress scrollbar updates for this pass. if (newHeightOfARow != mHeightOfARow || (isInDropdownMode && (oldHeight != aDesiredSize.height || - oldHeight != GetSize().height))) { + oldHeight != GetPhysicalSize().height))) { mHeightOfARow = newHeightOfARow; list->SetSuppressScrollbarUpdate(true); } } return rv; } diff --git a/layout/generic/StickyScrollContainer.cpp b/layout/generic/StickyScrollContainer.cpp --- a/layout/generic/StickyScrollContainer.cpp +++ b/layout/generic/StickyScrollContainer.cpp @@ -151,22 +151,22 @@ StickyScrollContainer::ComputeStickyLimi nsRect rect = nsLayoutUtils::GetAllInFlowRectsUnion(aFrame, aFrame->GetParent()); // Containing block limits if (cbFrame != scrolledFrame) { *aContain = nsLayoutUtils::GetAllInFlowRectsUnion(cbFrame, cbFrame); aContain->MoveBy(-aFrame->GetParent()->GetOffsetTo(cbFrame)); - aContain->Deflate(cbFrame->GetUsedBorderAndPadding()); - aContain->Deflate(aFrame->GetUsedMargin()); + aContain->Deflate(cbFrame->GetUsedPhysicalBorderAndPadding()); + aContain->Deflate(aFrame->GetUsedPhysicalMargin()); aContain->Deflate(nsMargin(0, rect.width, rect.height, 0)); } - nsMargin sfPadding = scrolledFrame->GetUsedPadding(); + nsMargin sfPadding = scrolledFrame->GetUsedPhysicalPadding(); nsPoint sfOffset = aFrame->GetParent()->GetOffsetTo(scrolledFrame); // Top if (computedOffsets->top != NS_AUTOOFFSET) { aStick->SetTopEdge(mScrollPosition.y + sfPadding.top + computedOffsets->top - sfOffset.y); } @@ -197,27 +197,27 @@ StickyScrollContainer::ComputeStickyLimi direction == NS_STYLE_DIRECTION_RTL || rect.width <= sfSize.width - computedOffsets->LeftRight())) { aStick->SetRightEdge(mScrollPosition.x + sfPadding.left + sfSize.width - computedOffsets->right - rect.width - sfOffset.x); } // These limits are for the bounding box of aFrame's continuations. Convert // to limits for aFrame itself. - aStick->MoveBy(aFrame->GetPosition() - rect.TopLeft()); + aStick->MoveBy(aFrame->GetPhysicalPosition() - rect.TopLeft()); } nsPoint StickyScrollContainer::ComputePosition(nsIFrame* aFrame) const { nsRect stick; nsRect contain; ComputeStickyLimits(aFrame, &stick, &contain); - nsPoint position = aFrame->GetNormalPosition(); + nsPoint position = aFrame->GetNormalPhysicalPosition(); // For each sticky direction (top, bottom, left, right), move the frame along // the appropriate axis, based on the scroll position, but limit this to keep // the element's margin box within the containing block. position.y = std::max(position.y, std::min(stick.y, contain.YMost())); position.y = std::min(position.y, std::max(stick.YMost(), contain.y)); position.x = std::max(position.x, std::min(stick.x, contain.XMost())); position.x = std::min(position.x, std::max(stick.XMost(), contain.x)); @@ -231,17 +231,17 @@ StickyScrollContainer::GetScrollRanges(n { nsRect stick; nsRect contain; ComputeStickyLimits(aFrame, &stick, &contain); aOuter->SetRect(nscoord_MIN/2, nscoord_MIN/2, nscoord_MAX, nscoord_MAX); aInner->SetRect(nscoord_MIN/2, nscoord_MIN/2, nscoord_MAX, nscoord_MAX); - const nsPoint normalPosition = aFrame->GetNormalPosition(); + const nsPoint normalPosition = aFrame->GetNormalPhysicalPosition(); // Bottom and top if (stick.YMost() != nscoord_MAX/2) { aOuter->SetTopEdge(contain.y - stick.YMost()); aInner->SetTopEdge(normalPosition.y - stick.YMost()); } if (stick.y != nscoord_MIN/2) { @@ -262,23 +262,23 @@ StickyScrollContainer::GetScrollRanges(n } void StickyScrollContainer::PositionContinuations(nsIFrame* aFrame) { NS_ASSERTION(!aFrame->GetPrevContinuation(), "Should be starting from the first continuation"); nsPoint newPosition = ComputePosition(aFrame); - nsPoint translation = newPosition - aFrame->GetPosition(); + nsPoint translation = newPosition - aFrame->GetPhysicalPosition(); aFrame->SetPosition(newPosition); // Move all continuation frames by the same amount. for (nsIFrame* cont = aFrame->GetNextContinuation(); cont; cont = cont->GetNextContinuation()) { - cont->SetPosition(cont->GetPosition() + translation); + cont->SetPosition(cont->GetPhysicalPosition() + translation); } } void StickyScrollContainer::UpdatePositions(nsPoint aScrollPosition, nsIFrame* aSubtreeRoot) { #ifdef DEBUG diff --git a/layout/generic/TextOverflow.cpp b/layout/generic/TextOverflow.cpp --- a/layout/generic/TextOverflow.cpp +++ b/layout/generic/TextOverflow.cpp @@ -352,17 +352,17 @@ void TextOverflow::AnalyzeMarkerEdges(nsIFrame* aFrame, const nsIAtom* aFrameType, const nsRect& aInsideMarkersArea, FrameHashtable* aFramesToHide, AlignmentEdges* aAlignmentEdges, bool* aFoundVisibleTextOrAtomic, InnerClipEdges* aClippedMarkerEdges) { - nsRect borderRect(aFrame->GetOffsetTo(mBlock), aFrame->GetSize()); + nsRect borderRect(aFrame->GetOffsetTo(mBlock), aFrame->GetPhysicalSize()); nscoord leftOverlap = std::max(aInsideMarkersArea.x - borderRect.x, 0); nscoord rightOverlap = std::max(borderRect.XMost() - aInsideMarkersArea.XMost(), 0); bool insideLeftEdge = aInsideMarkersArea.x <= borderRect.XMost(); bool insideRightEdge = borderRect.x <= aInsideMarkersArea.XMost(); if (leftOverlap > 0) { diff --git a/layout/generic/nsAbsoluteContainingBlock.cpp b/layout/generic/nsAbsoluteContainingBlock.cpp --- a/layout/generic/nsAbsoluteContainingBlock.cpp +++ b/layout/generic/nsAbsoluteContainingBlock.cpp @@ -395,17 +395,17 @@ nsAbsoluteContainingBlock::ReflowAbsolut // Get the border values const nsMargin& border = aReflowState.mStyleBorder->GetComputedBorder(); bool constrainHeight = (aReflowState.availableHeight != NS_UNCONSTRAINEDSIZE) && aConstrainHeight // Don't split if told not to (e.g. for fixed frames) && (aDelegatingFrame->GetType() != nsGkAtoms::inlineFrame) //XXX we don't handle splitting frames for inline absolute containing blocks yet - && (aKidFrame->GetRect().y <= aReflowState.availableHeight); + && (aKidFrame->GetPhysicalRect().y <= aReflowState.availableHeight); // Don't split things below the fold. (Ideally we shouldn't *have* // anything totally below the fold, but we can't position frames // across next-in-flow breaks yet. if (constrainHeight) { kidReflowState.availableHeight = aReflowState.availableHeight - border.top - kidReflowState.mComputedMargin.top; if (NS_AUTOOFFSET != kidReflowState.mComputedOffsets.top) kidReflowState.availableHeight -= kidReflowState.mComputedOffsets.top; diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp --- a/layout/generic/nsBlockFrame.cpp +++ b/layout/generic/nsBlockFrame.cpp @@ -435,17 +435,17 @@ nsBlockFrame::GetBaseline() const return result; return nsFrame::GetBaseline(); } nscoord nsBlockFrame::GetCaretBaseline() const { nsRect contentRect = GetContentRect(); - nsMargin bp = GetUsedBorderAndPadding(); + nsMargin bp = GetUsedPhysicalBorderAndPadding(); if (!mLines.empty()) { const_line_iterator line = begin_lines(); const nsLineBox* firstLine = line; if (firstLine->GetChildCount()) { return bp.top + firstLine->mFirstChild->GetCaretBaseline(); } } @@ -916,17 +916,17 @@ nsBlockFrame::Reflow(nsPresContext* mutableReflowState.construct(aReflowState); mutableReflowState.ref().availableHeight = NS_UNCONSTRAINEDSIZE; reflowState = mutableReflowState.addr(); } } // See comment below about oldSize. Use *only* for the // abs-pos-containing-block-size-change optimization! - nsSize oldSize = GetSize(); + nsSize oldSize = GetPhysicalSize(); // Should we create a float manager? nsAutoFloatManager autoFloatManager(const_cast(*reflowState)); // XXXldb If we start storing the float manager in the frame rather // than keeping it around only during reflow then we should create it // only when there are actually floats to manage. Otherwise things // like tables will gain significant bloat. @@ -1077,17 +1077,17 @@ nsBlockFrame::Reflow(nsPresContext* if (havePosition && !BulletIsEmpty()) { // We have some lines to align the bullet with. // Doing the alignment using the baseline will also cater for // bullets that are placed next to a child block (bug 92896) // Tall bullets won't look particularly nice here... - nsRect bbox = bullet->GetRect(); + nsRect bbox = bullet->GetPhysicalRect(); bbox.y = position.mBaseline - metrics.ascent; bullet->SetRect(bbox); } // Otherwise just leave the bullet where it is, up against our top padding. } CheckFloats(state); @@ -1410,17 +1410,17 @@ nsBlockFrame::ComputeOverflowAreas(const // Factor an outside bullet in; normally the bullet will be factored into // the line-box's overflow areas. However, if the line is a block // line then it won't; if there are no lines, it won't. So just // factor it in anyway (it can't hurt if it was already done). // XXXldb Can we just fix GetOverflowArea instead? nsIFrame* outsideBullet = GetOutsideBullet(); if (outsideBullet) { - areas.UnionAllWith(outsideBullet->GetRect()); + areas.UnionAllWith(outsideBullet->GetPhysicalRect()); } // Factor in the bottom edge of the children. Child frames will be added // to the overflow area as we iterate through the lines, but their margins // won't, so we need to account for bottom margins here. // REVIEW: For now, we do this for both visual and scrollable area, // although when we make scrollable overflow area not be a subset of // visual, we can change this. @@ -2324,17 +2324,17 @@ nsBlockFrame::ReflowDirtyLines(nsBlockRe nsLayoutUtils::GetCenteredFontBaseline(fm, aState.mMinLineHeight); nscoord minDescent = aState.mMinLineHeight - minAscent; aState.mY += std::max(minAscent, metrics.ascent) + std::max(minDescent, metrics.height - metrics.ascent); nscoord offset = minAscent - metrics.ascent; if (offset > 0) { - bullet->SetRect(bullet->GetRect() + nsPoint(0, offset)); + bullet->SetRect(bullet->GetPhysicalRect() + nsPoint(0, offset)); } } } if (foundAnyClears) { AddStateBits(NS_BLOCK_HAS_CLEAR_CHILDREN); } else { RemoveStateBits(NS_BLOCK_HAS_CLEAR_CHILDREN); @@ -2860,17 +2860,17 @@ nsBlockFrame::ReflowBlockFrame(nsBlockRe } nsIFrame* clearanceFrame = nullptr; nscoord startingY = aState.mY; nsCollapsingMargin incomingMargin = aState.mPrevBottomMargin; nscoord clearance; // Save the original position of the frame so that we can reposition // its view as needed. - nsPoint originalPosition = frame->GetPosition(); + nsPoint originalPosition = frame->GetPhysicalPosition(); while (true) { clearance = 0; nscoord topMargin = 0; bool mayNeedRetry = false; bool clearedFloats = false; if (applyTopMargin) { // Precompute the blocks top margin value so that we can get the // correct available space (there might be a float that's @@ -3049,17 +3049,17 @@ nsBlockFrame::ReflowBlockFrame(nsBlockRe aState.mPrevChild = frame; if (blockHtmlRS.WillReflowAgainForClearance()) { // If an ancestor of ours is going to reflow for clearance, we // need to avoid calling PlaceBlock, because it unsets dirty bits // on the child block (both itself, and through its call to // nsFrame::DidReflow), and those dirty bits imply dirtiness for // all of the child block, including the lines it didn't reflow. - NS_ASSERTION(originalPosition == frame->GetPosition(), + NS_ASSERTION(originalPosition == frame->GetPhysicalPosition(), "we need to call PositionChildViews"); return NS_OK; } #if defined(REFLOW_STATUS_COVERAGE) RecordReflowStatus(true, frameReflowStatus); #endif @@ -3250,17 +3250,17 @@ nsBlockFrame::ReflowBlockFrame(nsBlockRe } break; // out of the reflow retry loop } // Now that we've got its final position all figured out, position any child // views it may have. Note that the case when frame has a view got handled // by FinishReflowChild, but that function didn't have the coordinates needed // to correctly decide whether to reposition child views. - if (originalPosition != frame->GetPosition() && !frame->HasView()) { + if (originalPosition != frame->GetPhysicalPosition() && !frame->HasView()) { nsContainerFrame::PositionChildViews(frame); } #ifdef DEBUG VerifyLines(true); #endif return rv; } @@ -5962,17 +5962,17 @@ nsBlockFrame::RecoverFloatsFor(nsIFrame* nsBlockFrame* block = nsLayoutUtils::GetAsBlock(aFrame); // Don't recover any state inside a block that has its own space manager // (we don't currently have any blocks like this, though, thanks to our // use of extra frames for 'overflow') if (block && !nsBlockFrame::BlockNeedsFloatManager(block)) { // If the element is relatively positioned, then adjust x and y // accordingly so that we consider relatively positioned frames // at their original position. - nsPoint pos = block->GetNormalPosition(); + nsPoint pos = block->GetNormalPhysicalPosition(); aFloatManager.Translate(pos.x, pos.y); block->RecoverFloats(aFloatManager); aFloatManager.Translate(-pos.x, -pos.y); } } ////////////////////////////////////////////////////////////////////// // Painting, event handling diff --git a/layout/generic/nsBlockReflowState.cpp b/layout/generic/nsBlockReflowState.cpp --- a/layout/generic/nsBlockReflowState.cpp +++ b/layout/generic/nsBlockReflowState.cpp @@ -629,17 +629,17 @@ nsBlockReflowState::FlowAndPlaceFloat(ns // If it's a floating first-letter, we need to reflow it before we // know how wide it is (since we don't compute which letters are part // of the first letter until reflow!). bool isLetter = aFloat->GetType() == nsGkAtoms::letterFrame; if (isLetter) { mBlock->ReflowFloat(*this, adjustedAvailableSpace, aFloat, floatMargin, floatOffsets, false, reflowStatus); - floatMarginWidth = aFloat->GetSize().width + floatMargin.LeftRight(); + floatMarginWidth = aFloat->GetPhysicalSize().width + floatMargin.LeftRight(); NS_ASSERTION(NS_FRAME_IS_COMPLETE(reflowStatus), "letter frames shouldn't break, and if they do now, " "then they're breaking at the wrong point"); } // Find a place to place the float. The CSS2 spec doesn't want // floats overlapping each other or sticking out of the containing // block if possible (CSS2 spec section 9.5.1, see the rule list). @@ -775,32 +775,32 @@ nsBlockReflowState::FlowAndPlaceFloat(ns // (This code is only for DISABLE_FLOAT_BREAKING_IN_COLUMNS .) // // Likewise, if none of the float fit, and it needs to be pushed in // its entirety to the next page (NS_FRAME_IS_TRUNCATED or // NS_INLINE_IS_BREAK_BEFORE), we need to do the same. if ((mContentArea.height != NS_UNCONSTRAINEDSIZE && adjustedAvailableSpace.height == NS_UNCONSTRAINEDSIZE && !mustPlaceFloat && - aFloat->GetSize().height + floatMargin.TopBottom() > + aFloat->GetPhysicalSize().height + floatMargin.TopBottom() > mContentArea.YMost() - floatY) || NS_FRAME_IS_TRUNCATED(reflowStatus) || NS_INLINE_IS_BREAK_BEFORE(reflowStatus)) { PushFloatPastBreak(aFloat); return false; } // We can't use aFloat->ShouldAvoidBreakInside(mReflowState) here since // its mIsTopOfPage may be true even though the float isn't at the // top when floatY > 0. if (mContentArea.height != NS_UNCONSTRAINEDSIZE && !mustPlaceFloat && (!mReflowState.mFlags.mIsTopOfPage || floatY > 0) && NS_STYLE_PAGE_BREAK_AVOID == aFloat->StyleDisplay()->mBreakInside && (!NS_FRAME_IS_FULLY_COMPLETE(reflowStatus) || - aFloat->GetSize().height + floatMargin.TopBottom() > + aFloat->GetPhysicalSize().height + floatMargin.TopBottom() > mContentArea.YMost() - floatY) && !aFloat->GetPrevInFlow()) { PushFloatPastBreak(aFloat); return false; } // Calculate the actual origin of the float frame's border rect // relative to the parent block; the margin must be added in @@ -809,17 +809,17 @@ nsBlockReflowState::FlowAndPlaceFloat(ns floatMargin.top + floatY); // If float is relatively positioned, factor that in as well nsHTMLReflowState::ApplyRelativePositioning(aFloat, floatOffsets, &origin); // Position the float and make sure and views are properly // positioned. We need to explicitly position its child views as // well, since we're moving the float after flowing it. - bool moved = aFloat->GetPosition() != origin; + bool moved = aFloat->GetPhysicalPosition() != origin; if (moved) { aFloat->SetPosition(origin); nsContainerFrame::PositionFrameView(aFloat); nsContainerFrame::PositionChildViews(aFloat); } // Update the float combined area state // XXX Floats should really just get invalidated here if necessary @@ -861,17 +861,17 @@ nsBlockReflowState::FlowAndPlaceFloat(ns nsFrame::ListTag(stdout, mBlock); printf(": FlowAndPlaceFloat: AddFloat: txy=%d,%d (%d,%d) {%d,%d,%d,%d}\n", tx, ty, mFloatManagerX, mFloatManagerY, region.x, region.y, region.width, region.height); #endif #ifdef DEBUG if (nsBlockFrame::gNoisyReflow) { - nsRect r = aFloat->GetRect(); + nsRect r = aFloat->GetPhysicalRect(); nsFrame::IndentBy(stdout, nsBlockFrame::gNoiseIndent); printf("placed float: "); nsFrame::ListTag(stdout, aFloat); printf(" %d,%d,%d,%d\n", r.x, r.y, r.width, r.height); } #endif return true; diff --git a/layout/generic/nsBulletFrame.cpp b/layout/generic/nsBulletFrame.cpp --- a/layout/generic/nsBulletFrame.cpp +++ b/layout/generic/nsBulletFrame.cpp @@ -1628,17 +1628,17 @@ nsBulletFrame::GetImage() const return nullptr; } nscoord nsBulletFrame::GetBaseline() const { nscoord ascent = 0, bottomPadding; if (GetStateBits() & BULLET_FRAME_IMAGE_LOADING) { - ascent = GetRect().height; + ascent = GetPhysicalRect().height; } else { nsRefPtr fm; nsLayoutUtils::GetFontMetricsForFrame(this, getter_AddRefs(fm), GetFontSizeInflation()); const nsStyleList* myList = StyleList(); switch (myList->mListStyleType) { case NS_STYLE_LIST_STYLE_NONE: break; @@ -1653,17 +1653,17 @@ nsBulletFrame::GetBaseline() const ascent += bottomPadding; break; default: ascent = fm->MaxAscent(); break; } } - return ascent + GetUsedBorderAndPadding().top; + return ascent + GetUsedPhysicalBorderAndPadding().top; } diff --git a/layout/generic/nsCanvasFrame.cpp b/layout/generic/nsCanvasFrame.cpp --- a/layout/generic/nsCanvasFrame.cpp +++ b/layout/generic/nsCanvasFrame.cpp @@ -387,17 +387,17 @@ nsCanvasFrame::BuildDisplayList(nsDispla aLists.Outlines()->AppendNewToTop(new (aBuilder) nsDisplayCanvasFocus(aBuilder, this)); } void nsCanvasFrame::PaintFocus(nsRenderingContext& aRenderingContext, nsPoint aPt) { - nsRect focusRect(aPt, GetSize()); + nsRect focusRect(aPt, GetPhysicalSize()); nsIScrollableFrame *scrollableFrame = do_QueryFrame(GetParent()); if (scrollableFrame) { nsRect portRect = scrollableFrame->GetScrollPortRect(); focusRect.width = portRect.width; focusRect.height = portRect.height; focusRect.MoveBy(scrollableFrame->GetScrollPosition()); } @@ -533,30 +533,30 @@ nsCanvasFrame::Reflow(nsPresContext* // If the child frame was just inserted, then we're responsible for making sure // it repaints if (kidDirty) { // But we have a new child, which will affect our background, so // invalidate our whole rect. // Note: Even though we request to be sized to our child's size, our // scroll frame ensures that we are always the size of the viewport. - // Also note: GetPosition() on a CanvasFrame is always going to return - // (0, 0). We only want to invalidate GetRect() since Get*OverflowRect() + // Also note: GetPhysicalPosition() on a CanvasFrame is always going to return + // (0, 0). We only want to invalidate GetPhysicalRect() since Get*OverflowRect() // could also include overflow to our top and left (out of the viewport) // which doesn't need to be painted. nsIFrame* viewport = PresContext()->GetPresShell()->GetRootFrame(); viewport->InvalidateFrame(); } // Return our desired size. Normally it's what we're told, but // sometimes we can be given an unconstrained height (when a window // is sizing-to-content), and we should compute our desired height. aDesiredSize.width = aReflowState.ComputedWidth(); if (aReflowState.ComputedHeight() == NS_UNCONSTRAINEDSIZE) { - aDesiredSize.height = kidFrame->GetRect().height + + aDesiredSize.height = kidFrame->GetPhysicalRect().height + kidReflowState.mComputedMargin.TopBottom(); } else { aDesiredSize.height = aReflowState.ComputedHeight(); } aDesiredSize.SetOverflowAreasToDesiredBounds(); aDesiredSize.mOverflowAreas.UnionWith( kidDesiredSize.mOverflowAreas + kidPt); diff --git a/layout/generic/nsColumnSetFrame.cpp b/layout/generic/nsColumnSetFrame.cpp --- a/layout/generic/nsColumnSetFrame.cpp +++ b/layout/generic/nsColumnSetFrame.cpp @@ -89,28 +89,28 @@ nsColumnSetFrame::PaintColumnRule(nsRend // we support on borders! nsStyleBorder border(presContext); border.SetBorderWidth(NS_SIDE_LEFT, ruleWidth); border.SetBorderStyle(NS_SIDE_LEFT, ruleStyle); border.SetBorderColor(NS_SIDE_LEFT, ruleColor); // Get our content rect as an absolute coordinate, not relative to // our parent (which is what the X and Y normally is) - nsRect contentRect = GetContentRect() - GetRect().TopLeft() + aPt; + nsRect contentRect = GetContentRect() - GetPhysicalRect().TopLeft() + aPt; nsSize ruleSize(ruleWidth, contentRect.height); while (nextSibling) { // The frame tree goes RTL in RTL nsIFrame* leftSibling = isRTL ? nextSibling : child; nsIFrame* rightSibling = isRTL ? child : nextSibling; // Each child frame's position coordinates is actually relative to this nsColumnSetFrame. // linePt will be at the top-left edge to paint the line. - nsPoint edgeOfLeftSibling = leftSibling->GetRect().TopRight() + aPt; - nsPoint edgeOfRightSibling = rightSibling->GetRect().TopLeft() + aPt; + nsPoint edgeOfLeftSibling = leftSibling->GetPhysicalRect().TopRight() + aPt; + nsPoint edgeOfRightSibling = rightSibling->GetPhysicalRect().TopLeft() + aPt; nsPoint linePt((edgeOfLeftSibling.x + edgeOfRightSibling.x - ruleWidth) / 2, contentRect.y); nsRect lineRect(linePt, ruleSize); nsCSSRendering::PaintBorderWithStyleBorder(presContext, *aCtx, this, aDirtyRect, lineRect, border, StyleContext(), // Remember, we only have the "left" "border". Skip everything else (1 << NS_SIDE_TOP | 1 << NS_SIDE_RIGHT | 1 << NS_SIDE_BOTTOM)); @@ -351,17 +351,17 @@ PlaceFrameView(nsIFrame* aFrame) { if (aFrame->HasView()) nsContainerFrame::PositionFrameView(aFrame); else nsContainerFrame::PositionChildViews(aFrame); } static void MoveChildTo(nsIFrame* aParent, nsIFrame* aChild, nsPoint aOrigin) { - if (aChild->GetPosition() == aOrigin) { + if (aChild->GetPhysicalPosition() == aOrigin) { return; } aChild->SetPosition(aOrigin); PlaceFrameView(aChild); } nscoord @@ -608,17 +608,17 @@ nsColumnSetFrame::ReflowChildren(nsHTMLR allFit = false; } if (childContentBottom > availSize.height) { aColData.mMaxOverflowingHeight = std::max(childContentBottom, aColData.mMaxOverflowingHeight); } } - contentRect.UnionRect(contentRect, child->GetRect()); + contentRect.UnionRect(contentRect, child->GetPhysicalRect()); ConsiderChildOverflow(overflowRects, child); contentBottom = std::max(contentBottom, childContentBottom); aColData.mLastHeight = childContentBottom; aColData.mSumHeight += childContentBottom; // Build a continuation column if necessary nsIFrame* kidNextInFlow = child->GetNextInFlow(); diff --git a/layout/generic/nsContainerFrame.cpp b/layout/generic/nsContainerFrame.cpp --- a/layout/generic/nsContainerFrame.cpp +++ b/layout/generic/nsContainerFrame.cpp @@ -441,17 +441,17 @@ nsContainerFrame::CreateViewForFrame(nsI nsView* parentView = aFrame->GetParent()->GetClosestView(); NS_ASSERTION(parentView, "no parent with view"); nsViewManager* viewManager = parentView->GetViewManager(); NS_ASSERTION(viewManager, "null view manager"); // Create a view - nsView* view = viewManager->CreateView(aFrame->GetRect(), parentView); + nsView* view = viewManager->CreateView(aFrame->GetPhysicalRect(), parentView); SyncFrameViewProperties(aFrame->PresContext(), aFrame, nullptr, view); nsView* insertBefore = nsLayoutUtils::FindSiblingViewFor(parentView, aFrame); // we insert this view 'above' the insertBefore view, unless insertBefore is null, // in which case we want to call with aAbove == false to insert at the beginning // in document order viewManager->InsertChild(parentView, view, insertBefore, insertBefore != nullptr); @@ -494,17 +494,17 @@ nsContainerFrame::PositionFrameView(nsIF if (ancestorView != view->GetParent()) { NS_ASSERTION(ancestorView == view->GetParent()->GetParent(), "Allowed only one anonymous view between frames"); // parentFrame is responsible for positioning aKidFrame's view // explicitly return; } - pt += aKidFrame->GetPosition(); + pt += aKidFrame->GetPhysicalPosition(); vm->MoveViewTo(view, pt.x, pt.y); } nsresult nsContainerFrame::ReparentFrameView(nsPresContext* aPresContext, nsIFrame* aChildFrame, nsIFrame* aOldParentFrame, nsIFrame* aNewParentFrame) @@ -1033,17 +1033,17 @@ nsresult nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame, nsPresContext* aPresContext, const nsHTMLReflowState* aReflowState, const nsHTMLReflowMetrics& aDesiredSize, nscoord aX, nscoord aY, uint32_t aFlags) { - nsPoint curOrigin = aKidFrame->GetPosition(); + nsPoint curOrigin = aKidFrame->GetPhysicalPosition(); if (NS_FRAME_NO_MOVE_FRAME != (aFlags & NS_FRAME_NO_MOVE_FRAME)) { aKidFrame->SetRect(nsRect(aX, aY, aDesiredSize.width, aDesiredSize.height)); } else { aKidFrame->SetSize(nsSize(aDesiredSize.width, aDesiredSize.height)); } if (aKidFrame->HasView()) { @@ -1136,17 +1136,17 @@ nsContainerFrame::ReflowOverflowContaine // even if the frame isn't dirty. if (shouldReflowAllKids || NS_SUBTREE_DIRTY(frame)) { // Get prev-in-flow nsIFrame* prevInFlow = frame->GetPrevInFlow(); NS_ASSERTION(prevInFlow, "overflow container frame must have a prev-in-flow"); NS_ASSERTION(frame->GetStateBits() & NS_FRAME_IS_OVERFLOW_CONTAINER, "overflow container frame must have overflow container bit set"); - nsRect prevRect = prevInFlow->GetRect(); + nsRect prevRect = prevInFlow->GetPhysicalRect(); // Initialize reflow params nsSize availSpace(prevRect.width, aReflowState.availableHeight); nsHTMLReflowMetrics desiredSize; nsHTMLReflowState frameState(aPresContext, aReflowState, frame, availSpace); nsReflowStatus frameStatus; diff --git a/layout/generic/nsFlexContainerFrame.cpp b/layout/generic/nsFlexContainerFrame.cpp --- a/layout/generic/nsFlexContainerFrame.cpp +++ b/layout/generic/nsFlexContainerFrame.cpp @@ -927,17 +927,17 @@ FlexItem::GetNumAutoMarginsInAxis(AxisOr // Keeps track of our position along a particular axis (where a '0' position // corresponds to the 'start' edge of that axis). // This class shouldn't be instantiated directly -- rather, it should only be // instantiated via its subclasses defined below. class MOZ_STACK_CLASS PositionTracker { public: // Accessor for the current value of the position that we're tracking. - inline nscoord GetPosition() const { return mPosition; } + inline nscoord GetPhysicalPosition() const { return mPosition; } inline AxisOrientationType GetAxis() const { return mAxis; } // Advances our position across the start edge of the given margin, in the // axis we're tracking. void EnterMargin(const nsMargin& aMargin) { Side side = kAxisOrientationToSidesMap[mAxis][eAxisEdge_Start]; mPosition += MarginComponentForSide(aMargin, side); @@ -1995,17 +1995,17 @@ nsFlexContainerFrame::PositionItemInMain // Resolve any main-axis 'auto' margins on aChild to an actual value. aMainAxisPosnTracker.ResolveAutoMarginsInMainAxis(aItem); // Advance our position tracker to child's upper-left content-box corner, // and use that as its position in the main axis. aMainAxisPosnTracker.EnterMargin(aItem.GetMargin()); aMainAxisPosnTracker.EnterChildFrame(itemMainBorderBoxSize); - aItem.SetMainPosition(aMainAxisPosnTracker.GetPosition()); + aItem.SetMainPosition(aMainAxisPosnTracker.GetPhysicalPosition()); aMainAxisPosnTracker.ExitChildFrame(itemMainBorderBoxSize); aMainAxisPosnTracker.ExitMargin(aItem.GetMargin()); aMainAxisPosnTracker.TraversePackingSpace(); } // Helper method to take care of children who ASK_FOR_BASELINE, when // we need their baseline. @@ -2112,33 +2112,33 @@ nsFlexContainerFrame::SizeItemInCrossAxi } void nsFlexContainerFrame::PositionItemInCrossAxis( nscoord aLineStartPosition, SingleLineCrossAxisPositionTracker& aLineCrossAxisPosnTracker, FlexItem& aItem) { - MOZ_ASSERT(aLineCrossAxisPosnTracker.GetPosition() == 0, + MOZ_ASSERT(aLineCrossAxisPosnTracker.GetPhysicalPosition() == 0, "per-line cross-axis position tracker wasn't correctly reset"); // Resolve any to-be-stretched cross-sizes & auto margins in cross axis. aLineCrossAxisPosnTracker.ResolveStretchedCrossSize(aItem); aLineCrossAxisPosnTracker.ResolveAutoMarginsInCrossAxis(aItem); // Compute the cross-axis position of this item nscoord itemCrossBorderBoxSize = aItem.GetCrossSize() + aItem.GetBorderPaddingSizeInAxis(aLineCrossAxisPosnTracker.GetAxis()); aLineCrossAxisPosnTracker.EnterAlignPackingSpace(aItem); aLineCrossAxisPosnTracker.EnterMargin(aItem.GetMargin()); aLineCrossAxisPosnTracker.EnterChildFrame(itemCrossBorderBoxSize); aItem.SetCrossPosition(aLineStartPosition + - aLineCrossAxisPosnTracker.GetPosition()); + aLineCrossAxisPosnTracker.GetPhysicalPosition()); // Back out to cross-axis edge of the line. aLineCrossAxisPosnTracker.ResetPosition(); } NS_IMETHODIMP nsFlexContainerFrame::Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, @@ -2294,17 +2294,17 @@ nsFlexContainerFrame::Reflow(nsPresConte aReflowState, items); for (uint32_t i = 0; i < items.Length(); ++i) { PositionItemInMainAxis(mainAxisPosnTracker, items[i]); } // Cross-Axis Alignment - Flexbox spec section 9.6 // =============================================== for (uint32_t i = 0; i < items.Length(); ++i) { - PositionItemInCrossAxis(crossAxisPosnTracker.GetPosition(), + PositionItemInCrossAxis(crossAxisPosnTracker.GetPhysicalPosition(), lineCrossAxisPosnTracker, items[i]); } // Before giving each child a final reflow, calculate the origin of the // flex container's content box (with respect to its border-box), so that // we can compute our flex item's final positions. nsMargin containerBorderPadding(aReflowState.mComputedBorderPadding); ApplySkipSides(containerBorderPadding, &aReflowState); @@ -2409,17 +2409,17 @@ nsFlexContainerFrame::Reflow(nsPresConte // the container yet, then use this child's baseline as the container's // baseline. if (i == 0 && flexContainerAscent == nscoord_MIN) { ResolveReflowedChildAscent(curItem.Frame(), childDesiredSize); // (We use GetNormalPosition() instead of physicalPosn because we don't // want relative positioning on the child to affect the baseline that we // read from it). - flexContainerAscent = curItem.Frame()->GetNormalPosition().y + + flexContainerAscent = curItem.Frame()->GetNormalPhysicalPosition().y + childDesiredSize.ascent; } } nsSize desiredContentBoxSize = axisTracker.PhysicalSizeFromLogicalSizes(contentBoxMainSize, contentBoxCrossSize); diff --git a/layout/generic/nsFloatManager.cpp b/layout/generic/nsFloatManager.cpp --- a/layout/generic/nsFloatManager.cpp +++ b/layout/generic/nsFloatManager.cpp @@ -260,17 +260,17 @@ nsFloatManager::AddFloat(nsIFrame* aFloa return NS_OK; } nsRect nsFloatManager::CalculateRegionFor(nsIFrame* aFloat, const nsMargin& aMargin) { // We consider relatively positioned frames at their original position. - nsRect region(aFloat->GetNormalPosition(), aFloat->GetSize()); + nsRect region(aFloat->GetNormalPhysicalPosition(), aFloat->GetPhysicalSize()); // Float region includes its margin region.Inflate(aMargin); // Don't store rectangles with negative margin-box width or height in // the float manager; it can't deal with them. if (region.width < 0) { // Preserve the right margin-edge for left floats and the left @@ -287,30 +287,30 @@ nsFloatManager::CalculateRegionFor(nsIFr return region; } NS_DECLARE_FRAME_PROPERTY(FloatRegionProperty, nsIFrame::DestroyMargin) nsRect nsFloatManager::GetRegionFor(nsIFrame* aFloat) { - nsRect region = aFloat->GetRect(); + nsRect region = aFloat->GetPhysicalRect(); void* storedRegion = aFloat->Properties().Get(FloatRegionProperty()); if (storedRegion) { nsMargin margin = *static_cast(storedRegion); region.Inflate(margin); } return region; } void nsFloatManager::StoreRegionFor(nsIFrame* aFloat, nsRect& aRegion) { - nsRect rect = aFloat->GetRect(); + nsRect rect = aFloat->GetPhysicalRect(); FrameProperties props = aFloat->Properties(); if (aRegion.IsEqualEdges(rect)) { props.Delete(FloatRegionProperty()); } else { nsMargin* storedMargin = static_cast (props.Get(FloatRegionProperty())); if (!storedMargin) { diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -853,17 +853,17 @@ const nsIFrame::ChildListID nsIFrame::kO const nsIFrame::ChildListID nsIFrame::kOverflowOutOfFlowList; const nsIFrame::ChildListID nsIFrame::kPopupList; const nsIFrame::ChildListID nsIFrame::kPushedFloatsList; const nsIFrame::ChildListID nsIFrame::kSelectPopupList; const nsIFrame::ChildListID nsIFrame::kNoReflowPrincipalList; #endif /* virtual */ nsMargin -nsIFrame::GetUsedMargin() const +nsIFrame::GetUsedPhysicalMargin() const { nsMargin margin(0, 0, 0, 0); if (((mState & NS_FRAME_FIRST_REFLOW) && !(mState & NS_FRAME_IN_REFLOW)) || IsSVGText()) return margin; nsMargin *m = static_cast @@ -876,17 +876,17 @@ nsIFrame::GetUsedMargin() const #endif StyleMargin()->GetMargin(margin); NS_ASSERTION(hasMargin, "We should have a margin here! (out of memory?)"); } return margin; } /* virtual */ nsMargin -nsIFrame::GetUsedBorder() const +nsIFrame::GetUsedPhysicalBorder() const { nsMargin border(0, 0, 0, 0); if (((mState & NS_FRAME_FIRST_REFLOW) && !(mState & NS_FRAME_IN_REFLOW)) || IsSVGText()) return border; // Theme methods don't use const-ness. @@ -912,17 +912,17 @@ nsIFrame::GetUsedBorder() const border = *b; } else { border = StyleBorder()->GetComputedBorder(); } return border; } /* virtual */ nsMargin -nsIFrame::GetUsedPadding() const +nsIFrame::GetUsedPhysicalPadding() const { nsMargin padding(0, 0, 0, 0); if (((mState & NS_FRAME_FIRST_REFLOW) && !(mState & NS_FRAME_IN_REFLOW)) || IsSVGText()) return padding; // Theme methods don't use const-ness. @@ -971,27 +971,27 @@ nsIFrame::ApplySkipSides(nsMargin& aMarg aMargin.bottom = 0; if (skipSides & (1 << NS_SIDE_LEFT)) aMargin.left = 0; } nsRect nsIFrame::GetPaddingRectRelativeToSelf() const { - nsMargin bp(GetUsedBorder()); + nsMargin bp(GetUsedPhysicalBorder()); ApplySkipSides(bp); nsRect r(0, 0, mRect.width, mRect.height); r.Deflate(bp); return r; } nsRect nsIFrame::GetPaddingRect() const { - return GetPaddingRectRelativeToSelf() + GetPosition(); + return GetPaddingRectRelativeToSelf() + GetPhysicalPosition(); } bool nsIFrame::IsTransformed() const { return ((mState & NS_FRAME_MAY_BE_TRANSFORMED) && (StyleDisplay()->HasTransform(this) || IsSVGTransformed() || @@ -1027,17 +1027,17 @@ nsIFrame::Preserves3DChildren() const // If we're all scroll frame, then all descendants will be clipped, so we can't preserve 3d. if (GetType() == nsGkAtoms::scrollFrame) return false; nsRect temp; const nsStyleDisplay* displayStyle = StyleDisplay(); return !nsFrame::ShouldApplyOverflowClipping(this, displayStyle) && - !GetClipPropClipRect(displayStyle, &temp, GetSize()) && + !GetClipPropClipRect(displayStyle, &temp, GetPhysicalSize()) && !nsSVGIntegrationUtils::UsingEffectsForFrame(this); } bool nsIFrame::Preserves3D() const { if (!GetParent() || !GetParent()->Preserves3DChildren() || !StyleDisplay()->HasTransform(this)) { @@ -1076,27 +1076,27 @@ nsIFrame::ChildrenHavePerspective() cons return true; } return false; } nsRect nsIFrame::GetContentRectRelativeToSelf() const { - nsMargin bp(GetUsedBorderAndPadding()); + nsMargin bp(GetUsedPhysicalBorderAndPadding()); ApplySkipSides(bp); nsRect r(0, 0, mRect.width, mRect.height); r.Deflate(bp); return r; } nsRect nsIFrame::GetContentRect() const { - return GetContentRectRelativeToSelf() + GetPosition(); + return GetContentRectRelativeToSelf() + GetPhysicalPosition(); } bool nsIFrame::ComputeBorderRadii(const nsStyleCorners& aBorderRadius, const nsSize& aFrameSize, const nsSize& aBorderArea, int aSkipSides, nscoord aRadii[8]) @@ -1210,40 +1210,40 @@ nsIFrame::GetBorderRadii(nscoord aRadii[ // In an ideal world, we might have a way for the them to tell us an // border radius, but since we don't, we're better off assuming // zero. NS_FOR_CSS_HALF_CORNERS(corner) { aRadii[corner] = 0; } return false; } - nsSize size = GetSize(); + nsSize size = GetPhysicalSize(); return ComputeBorderRadii(StyleBorder()->mBorderRadius, size, size, GetSkipSides(), aRadii); } bool nsIFrame::GetPaddingBoxBorderRadii(nscoord aRadii[8]) const { if (!GetBorderRadii(aRadii)) return false; - InsetBorderRadii(aRadii, GetUsedBorder()); + InsetBorderRadii(aRadii, GetUsedPhysicalBorder()); NS_FOR_CSS_HALF_CORNERS(corner) { if (aRadii[corner]) return true; } return false; } bool nsIFrame::GetContentBoxBorderRadii(nscoord aRadii[8]) const { if (!GetBorderRadii(aRadii)) return false; - InsetBorderRadii(aRadii, GetUsedBorderAndPadding()); + InsetBorderRadii(aRadii, GetUsedPhysicalBorderAndPadding()); NS_FOR_CSS_HALF_CORNERS(corner) { if (aRadii[corner]) return true; } return false; } nsStyleContext* @@ -1262,17 +1262,17 @@ nsFrame::SetAdditionalStyleContext(int32 nscoord nsFrame::GetBaseline() const { NS_ASSERTION(!NS_SUBTREE_DIRTY(this), "frame must not be dirty"); // Default to the bottom margin edge, per CSS2.1's definition of the // 'baseline' value of 'vertical-align'. - return mRect.height + GetUsedMargin().bottom; + return mRect.height + GetUsedPhysicalMargin().bottom; } const nsFrameList& nsFrame::GetChildList(ChildListID aListID) const { if (IsAbsoluteContainer() && aListID == GetAbsoluteListID()) { return GetAbsoluteContainingBlock()->GetChildList(); @@ -1584,17 +1584,17 @@ nsIFrame::GetClipPropClipRect(const nsSt */ static bool ApplyClipPropClipping(nsDisplayListBuilder* aBuilder, const nsIFrame* aFrame, const nsStyleDisplay* aDisp, nsRect* aRect, DisplayListClipState::AutoSaveRestore& aClipState) { - if (!aFrame->GetClipPropClipRect(aDisp, aRect, aFrame->GetSize())) + if (!aFrame->GetClipPropClipRect(aDisp, aRect, aFrame->GetPhysicalSize())) return false; nsRect clipRect = *aRect + aBuilder->ToReferenceFrame(aFrame); aClipState.ClipContentDescendants(clipRect); return true; } /** @@ -1622,38 +1622,38 @@ ApplyOverflowClipping(nsDisplayListBuild nscoord radii[8]; bool haveRadii = aFrame->GetPaddingBoxBorderRadii(radii); aClipState.ClipContainingBlockDescendantsExtra(rect, haveRadii ? radii : nullptr); } #ifdef DEBUG static void PaintDebugBorder(nsIFrame* aFrame, nsRenderingContext* aCtx, const nsRect& aDirtyRect, nsPoint aPt) { - nsRect r(aPt, aFrame->GetSize()); + nsRect r(aPt, aFrame->GetPhysicalSize()); if (aFrame->HasView()) { aCtx->SetColor(NS_RGB(0,0,255)); } else { aCtx->SetColor(NS_RGB(255,0,0)); } aCtx->DrawRect(r); } static void PaintEventTargetBorder(nsIFrame* aFrame, nsRenderingContext* aCtx, const nsRect& aDirtyRect, nsPoint aPt) { - nsRect r(aPt, aFrame->GetSize()); + nsRect r(aPt, aFrame->GetPhysicalSize()); aCtx->SetColor(NS_RGB(128,0,128)); aCtx->DrawRect(r); } static void DisplayDebugBorders(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, const nsDisplayListSet& aLists) { // Draw a border around the child // REVIEW: From nsContainerFrame::PaintChild - if (nsFrame::GetShowFrameBorders() && !aFrame->GetRect().IsEmpty()) { + if (nsFrame::GetShowFrameBorders() && !aFrame->GetPhysicalRect().IsEmpty()) { aLists.Outlines()->AppendNewToTop(new (aBuilder) nsDisplayGeneric(aBuilder, aFrame, PaintDebugBorder, "DebugBorder", nsDisplayItem::TYPE_DEBUG_BORDER)); } // Draw a border around the current event target if (nsFrame::GetShowEventTargetFrameBorder() && aFrame->PresContext()->PresShell()->GetDrawEventTargetFrame() == aFrame) { aLists.Outlines()->AppendNewToTop(new (aBuilder) @@ -2583,17 +2583,17 @@ nsFrame::HandlePress(nsPresContext* aPre nsInputEvent* keyEvent = (nsInputEvent*)aEvent; if (!keyEvent->IsAlt()) { for (nsIContent* content = mContent; content; content = content->GetParent()) { if (nsContentUtils::ContentIsDraggable(content) && !content->IsEditable()) { // coordinate stuff is the fix for bug #55921 - if ((mRect - GetPosition()).Contains( + if ((mRect - GetPhysicalPosition()).Contains( nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, this))) return NS_OK; } } } // check whether style allows selection // if not, don't tell selection the mouse event even occurred. @@ -3311,17 +3311,17 @@ static FrameTarget GetSelectionClosestFr return DrillDownToSelectionFrame(aParent, true, aFlags); nsIFrame *closestFromLeft = nullptr, *closestFromRight = nullptr; nsRect rect = aLine->mBounds; nscoord closestLeft = rect.x, closestRight = rect.XMost(); for (int32_t n = aLine->GetChildCount(); n; --n, frame = frame->GetNextSibling()) { if (!SelfIsSelectable(frame, aFlags) || frame->IsEmpty()) continue; - nsRect frameRect = frame->GetRect(); + nsRect frameRect = frame->GetPhysicalRect(); if (aPoint.x >= frameRect.x) { if (aPoint.x < frameRect.XMost()) { return GetSelectionClosestFrameForChild(frame, aPoint, aFlags); } if (frameRect.XMost() >= closestLeft) { closestFromLeft = frame; closestLeft = frameRect.XMost(); } @@ -3473,17 +3473,17 @@ nsIFrame::ContentOffsets OffsetsForSingl if (aFrame->GetNextContinuation() || aFrame->GetPrevContinuation()) { offsets.offset = range.start; offsets.secondaryOffset = range.end; offsets.associateWithNext = true; return offsets; } // Figure out whether the offsets should be over, after, or before the frame - nsRect rect(nsPoint(0, 0), aFrame->GetSize()); + nsRect rect(nsPoint(0, 0), aFrame->GetPhysicalSize()); bool isBlock = aFrame->GetDisplay() != NS_STYLE_DISPLAY_INLINE; bool isRtl = (aFrame->StyleVisibility()->mDirection == NS_STYLE_DIRECTION_RTL); if ((isBlock && rect.y < aPoint.y) || (!isBlock && ((isRtl && rect.x + rect.width / 2 > aPoint.x) || (!isRtl && rect.x + rect.width / 2 < aPoint.x)))) { offsets.offset = range.end; if (rect.Contains(aPoint)) @@ -4054,17 +4054,17 @@ nsFrame::ComputeSimpleTightBounds(gfxCon } nsRect r(0, 0, 0, 0); ChildListIterator lists(this); for (; !lists.IsDone(); lists.Next()) { nsFrameList::Enumerator childFrames(lists.CurrentList()); for (; !childFrames.AtEnd(); childFrames.Next()) { nsIFrame* child = childFrames.get(); - r.UnionRect(r, child->ComputeTightBounds(aContext) + child->GetPosition()); + r.UnionRect(r, child->ComputeTightBounds(aContext) + child->GetPhysicalPosition()); } } return r; } /* virtual */ nsSize nsFrame::ComputeAutoSize(nsRenderingContext *aRenderingContext, nsSize aCBSize, nscoord aAvailableWidth, @@ -4382,25 +4382,25 @@ nsPoint nsIFrame::GetOffsetTo(const nsIF "Must have frame for destination coordinate system!"); NS_ASSERTION(PresContext() == aOther->PresContext(), "GetOffsetTo called on frames in different documents"); nsPoint offset(0, 0); const nsIFrame* f; for (f = this; f != aOther && f; f = f->GetParent()) { - offset += f->GetPosition(); + offset += f->GetPhysicalPosition(); } if (f != aOther) { // Looks like aOther wasn't an ancestor of |this|. So now we have // the root-frame-relative position of |this| in |offset|. Convert back // to the coordinates of aOther while (aOther) { - offset -= aOther->GetPosition(); + offset -= aOther->GetPhysicalPosition(); aOther = aOther->GetParent(); } } return offset; } nsPoint nsIFrame::GetOffsetToCrossDoc(const nsIFrame* aOther) const @@ -4427,17 +4427,17 @@ nsIFrame::GetOffsetToCrossDoc(const nsIF const nsIFrame* root = nullptr; // offset will hold the final offset // docOffset holds the currently accumulated offset at the current APD, it // will be converted and added to offset when the current APD changes. nsPoint offset(0, 0), docOffset(0, 0); const nsIFrame* f = this; int32_t currAPD = PresContext()->AppUnitsPerDevPixel(); while (f && f != aOther) { - docOffset += f->GetPosition(); + docOffset += f->GetPhysicalPosition(); nsIFrame* parent = f->GetParent(); if (parent) { f = parent; } else { nsPoint newOffset(0, 0); root = f; f = nsLayoutUtils::GetCrossDocParentFrame(f, &newOffset); int32_t newAPD = f ? f->PresContext()->AppUnitsPerDevPixel() : 0; @@ -4504,31 +4504,31 @@ nsRect nsIFrame::GetScreenRectInAppUnits presContext->PresShell()->GetViewManager()->GetRootWidget(getter_AddRefs(rootWidget)); if (rootWidget) { nsIntPoint rootDevPx = rootWidget->WidgetToScreenOffset(); rootScreenPos.x = presContext->DevPixelsToAppUnits(rootDevPx.x); rootScreenPos.y = presContext->DevPixelsToAppUnits(rootDevPx.y); } } - return nsRect(rootScreenPos + GetOffsetTo(rootFrame), GetSize()); + return nsRect(rootScreenPos + GetOffsetTo(rootFrame), GetPhysicalSize()); } // Returns the offset from this frame to the closest geometric parent that // has a view. Also returns the containing view or null in case of error NS_IMETHODIMP nsFrame::GetOffsetFromView(nsPoint& aOffset, nsView** aView) const { NS_PRECONDITION(nullptr != aView, "null OUT parameter pointer"); nsIFrame* frame = (nsIFrame*)this; *aView = nullptr; aOffset.MoveTo(0, 0); do { - aOffset += frame->GetPosition(); + aOffset += frame->GetPhysicalPosition(); frame = frame->GetParent(); } while (frame && !frame->HasView()); if (frame) *aView = frame->GetView(); return NS_OK; } nsIWidget* @@ -5122,44 +5122,44 @@ ComputeOutlineAndEffectsRect(nsIFrame* a } return r; } void nsIFrame::MovePositionBy(const nsPoint& aTranslation) { - nsPoint position = GetNormalPosition() + aTranslation; + nsPoint position = GetNormalPhysicalPosition() + aTranslation; const nsMargin* computedOffsets = nullptr; if (IsRelativelyPositioned()) { computedOffsets = static_cast (Properties().Get(nsIFrame::ComputedOffsetProperty())); } nsHTMLReflowState::ApplyRelativePositioning(this, computedOffsets ? *computedOffsets : nsMargin(), &position); NS_ASSERTION(StyleDisplay()->mPosition == NS_STYLE_POSITION_STICKY || - GetPosition() + aTranslation == position, + GetPhysicalPosition() + aTranslation == position, "MovePositionBy should always lead to the movement " "specified, unless the frame is position:sticky"); SetPosition(position); } nsPoint -nsIFrame::GetNormalPosition() const +nsIFrame::GetNormalPhysicalPosition() const { // It might be faster to first check // StyleDisplay()->IsRelativelyPositionedStyle(). nsPoint* normalPosition = static_cast (Properties().Get(NormalPositionProperty())); if (normalPosition) { return *normalPosition; } - return GetPosition(); + return GetPhysicalPosition(); } nsRect nsIFrame::GetOverflowRect(nsOverflowType aType) const { NS_ABORT_IF_FALSE(aType == eVisualOverflow || aType == eScrollableOverflow, "unexpected type"); @@ -5176,30 +5176,30 @@ nsIFrame::GetOverflowRect(nsOverflowType GetOverflowAreasProperty())->Overflow(aType); } if (aType == eVisualOverflow && mOverflow.mType != NS_FRAME_OVERFLOW_NONE) { return GetVisualOverflowFromDeltas(); } - return nsRect(nsPoint(0, 0), GetSize()); + return nsRect(nsPoint(0, 0), GetPhysicalSize()); } nsOverflowAreas nsIFrame::GetOverflowAreas() const { if (mOverflow.mType == NS_FRAME_OVERFLOW_LARGE) { // there is an overflow rect, and it's not stored as deltas but as // a separately-allocated rect return *const_cast(this)->GetOverflowAreasProperty(); } return nsOverflowAreas(GetVisualOverflowFromDeltas(), - nsRect(nsPoint(0, 0), GetSize())); + nsRect(nsPoint(0, 0), GetPhysicalSize())); } nsRect nsIFrame::GetScrollableOverflowRectRelativeToParent() const { return GetScrollableOverflowRect() + mRect.TopLeft(); } @@ -5225,25 +5225,25 @@ nsIFrame::GetPreEffectsVisualOverflowRec /* virtual */ bool nsFrame::UpdateOverflow() { MOZ_ASSERT(!(mState & NS_FRAME_SVG_LAYOUT) || !(mState & NS_FRAME_IS_NONDISPLAY), "Non-display SVG do not maintain visual overflow rects"); - nsRect rect(nsPoint(0, 0), GetSize()); + nsRect rect(nsPoint(0, 0), GetPhysicalSize()); nsOverflowAreas overflowAreas(rect, rect); bool isBox = IsBoxFrame() || IsBoxWrapped(); if (!isBox || (!IsCollapsed() && !DoesClipChildren())) { nsLayoutUtils::UnionChildOverflow(this, overflowAreas); } - if (FinishAndStoreOverflow(overflowAreas, GetSize())) { + if (FinishAndStoreOverflow(overflowAreas, GetPhysicalSize())) { nsView* view = GetView(); if (view) { uint32_t flags = 0; GetLayoutFlags(flags); if ((flags & NS_FRAME_NO_SIZE_VIEW) == 0) { // Make sure the frame's view is properly sized. nsViewManager* vm = view->GetViewManager(); @@ -5705,17 +5705,17 @@ nsIFrame::IsFrameSelected() const return nsRange::IsNodeSelected(GetContent(), 0, GetContent()->GetChildCount()); } NS_IMETHODIMP nsFrame::GetPointFromOffset(int32_t inOffset, nsPoint* outPoint) { NS_PRECONDITION(outPoint != nullptr, "Null parameter"); - nsRect contentRect = GetContentRect() - GetPosition(); + nsRect contentRect = GetContentRect() - GetPhysicalPosition(); nsPoint pt = contentRect.TopLeft(); if (mContent) { nsIContent* newContent = mContent->GetParent(); if (newContent){ int32_t newOffset = newContent->IndexOf(mContent); bool isRTL = (NS_GET_EMBEDDING_LEVEL(this) & 1) == 1; @@ -5731,17 +5731,17 @@ nsFrame::GetPointFromOffset(int32_t inOf NS_IMETHODIMP nsFrame::GetChildFrameContainingOffset(int32_t inContentOffset, bool inHint, int32_t* outFrameContentOffset, nsIFrame **outChildFrame) { NS_PRECONDITION(outChildFrame && outFrameContentOffset, "Null parameter"); *outFrameContentOffset = (int32_t)inHint; //the best frame to reflect any given offset would be a visible frame if possible //i.e. we are looking for a valid frame to place the blinking caret - nsRect rect = GetRect(); + nsRect rect = GetPhysicalRect(); if (!rect.width || !rect.height) { //if we have a 0 width or height then lets look for another frame that possibly has //the same content. If we have no frames in flow then just let us return 'this' frame nsIFrame* nextFlow = GetNextInFlow(); if (nextFlow) return nextFlow->GetChildFrameContainingOffset(inContentOffset, inHint, outFrameContentOffset, outChildFrame); } @@ -5868,17 +5868,17 @@ nsFrame::GetNextPrevLineFromeBlockFrame( if (NS_FAILED(result)) return result; nsIFrame *storeOldResultFrame = resultFrame; while ( !found ){ nsPoint point; point.x = aPos->mDesiredX; - nsRect tempRect = resultFrame->GetRect(); + nsRect tempRect = resultFrame->GetPhysicalRect(); nsPoint offset; nsView * view; //used for call of get offset from view result = resultFrame->GetOffsetFromView(offset, &view); if (NS_FAILED(result)) return result; point.y = tempRect.height + offset.y; //special check. if we allow non-text selection then we can allow a hit location to fall before a table. @@ -6755,17 +6755,17 @@ nsView* nsIFrame::GetClosestView(nsPoint { nsPoint offset(0,0); for (const nsIFrame *f = this; f; f = f->GetParent()) { if (f->HasView()) { if (aOffset) *aOffset = offset; return f->GetView(); } - offset += f->GetPosition(); + offset += f->GetPhysicalPosition(); } NS_NOTREACHED("No view on any parent? How did that happen?"); return nullptr; } /* virtual */ void @@ -6839,17 +6839,17 @@ nsIFrame::SetOverflowAreas(const nsOverf return changed; } const nsRect& vis = aOverflowAreas.VisualOverflow(); uint32_t l = -vis.x, // left edge: positive delta is leftwards t = -vis.y, // top: positive is upwards r = vis.XMost() - mRect.width, // right: positive is rightwards b = vis.YMost() - mRect.height; // bottom: positive is downwards - if (aOverflowAreas.ScrollableOverflow().IsEqualEdges(nsRect(nsPoint(0, 0), GetSize())) && + if (aOverflowAreas.ScrollableOverflow().IsEqualEdges(nsRect(nsPoint(0, 0), GetPhysicalSize())) && l <= NS_FRAME_OVERFLOW_DELTA_MAX && t <= NS_FRAME_OVERFLOW_DELTA_MAX && r <= NS_FRAME_OVERFLOW_DELTA_MAX && b <= NS_FRAME_OVERFLOW_DELTA_MAX && // we have to check these against zero because we *never* want to // set a frame as having no overflow in this function. This is // because FinishAndStoreOverflow calls this function prior to // SetRect based on whether the overflow areas match aNewSize. @@ -6865,17 +6865,17 @@ nsIFrame::SetOverflowAreas(const nsOverf // no-overflow. mOverflow.mVisualDeltas.mLeft = l; mOverflow.mVisualDeltas.mTop = t; mOverflow.mVisualDeltas.mRight = r; mOverflow.mVisualDeltas.mBottom = b; // There was no scrollable overflow before, and there isn't now. return oldDeltas != mOverflow.mVisualDeltas; } else { - bool changed = !aOverflowAreas.ScrollableOverflow().IsEqualEdges(nsRect(nsPoint(0, 0), GetSize())) || + bool changed = !aOverflowAreas.ScrollableOverflow().IsEqualEdges(nsRect(nsPoint(0, 0), GetPhysicalSize())) || !aOverflowAreas.VisualOverflow().IsEqualEdges(GetVisualOverflowFromDeltas()); // it's a large overflow area that we need to store as a property mOverflow.mType = NS_FRAME_OVERFLOW_LARGE; nsOverflowAreas* overflow = GetOverflowAreasProperty(); NS_ASSERTION(overflow, "should have created areas"); *overflow = aOverflowAreas; return changed; @@ -7026,33 +7026,33 @@ nsIFrame::FinishAndStoreOverflow(nsOverf } return anyOverflowChanged; } void nsIFrame::RecomputePerspectiveChildrenOverflow(const nsStyleContext* aStartStyle, const nsRect* aBounds) { // Children may check our size when getting our transform, make sure it's valid. - nsSize oldSize = GetSize(); + nsSize oldSize = GetPhysicalSize(); if (aBounds) { SetSize(aBounds->Size()); } nsIFrame::ChildListIterator lists(this); for (; !lists.IsDone(); lists.Next()) { nsFrameList::Enumerator childFrames(lists.CurrentList()); for (; !childFrames.AtEnd(); childFrames.Next()) { nsIFrame* child = childFrames.get(); if ((child->GetStateBits() & NS_FRAME_SVG_LAYOUT) && (child->GetStateBits() & NS_FRAME_IS_NONDISPLAY)) { continue; // frame does not maintain overflow rects } if (child->HasPerspective()) { nsOverflowAreas* overflow = static_cast(child->Properties().Get(nsIFrame::InitialOverflowProperty())); - nsRect bounds(nsPoint(0, 0), child->GetSize()); + nsRect bounds(nsPoint(0, 0), child->GetPhysicalSize()); if (overflow) { nsOverflowAreas overflowCopy = *overflow; child->FinishAndStoreOverflow(overflowCopy, bounds.Size()); } else { nsOverflowAreas boundsOverflow; boundsOverflow.SetAllTo(bounds); child->FinishAndStoreOverflow(boundsOverflow, bounds.Size()); } @@ -7076,17 +7076,17 @@ nsIFrame::RecomputePerspectiveChildrenOv * depends on this for transform-origin etc). These weren't necessarily correct * when we reflowed initially, so walk over all preserve-3d children and repeat the * overflow calculation. */ static void RecomputePreserve3DChildrenOverflow(nsIFrame* aFrame, const nsRect* aBounds) { // Children may check our size when getting our transform, make sure it's valid. - nsSize oldSize = aFrame->GetSize(); + nsSize oldSize = aFrame->GetPhysicalSize(); if (aBounds) { aFrame->SetSize(aBounds->Size()); } nsIFrame::ChildListIterator lists(aFrame); for (; !lists.IsDone(); lists.Next()) { nsFrameList::Enumerator childFrames(lists.CurrentList()); for (; !childFrames.AtEnd(); childFrames.Next()) { nsIFrame* child = childFrames.get(); @@ -7094,17 +7094,17 @@ RecomputePreserve3DChildrenOverflow(nsIF (child->GetStateBits() & NS_FRAME_IS_NONDISPLAY)) { continue; // frame does not maintain overflow rects } if (child->Preserves3DChildren()) { RecomputePreserve3DChildrenOverflow(child, NULL); } else if (child->Preserves3D()) { nsOverflowAreas* overflow = static_cast(child->Properties().Get(nsIFrame::InitialOverflowProperty())); - nsRect bounds(nsPoint(0, 0), child->GetSize()); + nsRect bounds(nsPoint(0, 0), child->GetPhysicalSize()); if (overflow) { nsOverflowAreas overflowCopy = *overflow; child->FinishAndStoreOverflow(overflowCopy, bounds.Size()); } else { nsOverflowAreas boundsOverflow; boundsOverflow.SetAllTo(bounds); child->FinishAndStoreOverflow(boundsOverflow, bounds.Size()); } @@ -7114,17 +7114,17 @@ RecomputePreserve3DChildrenOverflow(nsIF // Restore our old size just in case something depends on this elesewhere. aFrame->SetSize(oldSize); // Only repeat computing our overflow in recursive calls since the initial caller is still // in the middle of doing this and we don't want an infinite loop. if (!aBounds) { nsOverflowAreas* overflow = static_cast(aFrame->Properties().Get(nsIFrame::InitialOverflowProperty())); - nsRect bounds(nsPoint(0, 0), aFrame->GetSize()); + nsRect bounds(nsPoint(0, 0), aFrame->GetPhysicalSize()); if (overflow) { nsOverflowAreas overflowCopy = *overflow; overflowCopy.UnionAllWith(bounds); aFrame->FinishAndStoreOverflow(overflowCopy, bounds.Size()); } else { nsOverflowAreas boundsOverflow; boundsOverflow.SetAllTo(bounds); aFrame->FinishAndStoreOverflow(boundsOverflow, bounds.Size()); @@ -7148,17 +7148,17 @@ nsIFrame::ComputePreserve3DChildrenOverf nsRect childVisual; nsRect childScrollable; nsIFrame::ChildListIterator lists(this); for (; !lists.IsDone(); lists.Next()) { nsFrameList::Enumerator childFrames(lists.CurrentList()); for (; !childFrames.AtEnd(); childFrames.Next()) { nsIFrame* child = childFrames.get(); - nsPoint offset = child->GetPosition(); + nsPoint offset = child->GetPhysicalPosition(); nsRect visual = child->GetVisualOverflowRect(); nsRect scrollable = child->GetScrollableOverflowRect(); visual.MoveBy(offset); scrollable.MoveBy(offset); if (child->Preserves3D()) { childVisual = childVisual.Union(visual); childScrollable = childScrollable.Union(scrollable); } else { @@ -7176,17 +7176,17 @@ nsIFrame::ComputePreserve3DChildrenOverf aOverflowAreas.Overflow(eScrollableOverflow) = aOverflowAreas.Overflow(eScrollableOverflow).Union(childScrollable); } void nsFrame::ConsiderChildOverflow(nsOverflowAreas& aOverflowAreas, nsIFrame* aChildFrame) { aOverflowAreas.UnionWith(aChildFrame->GetOverflowAreas() + - aChildFrame->GetPosition()); + aChildFrame->GetPhysicalPosition()); } /** * This function takes a "special" frame and _if_ that frame is an anonymous * block created by an ib split it returns the block's preceding inline. This * is needed because the split inline's style context is the parent of the * anonymous block's style context. * @@ -7556,17 +7556,17 @@ nsFrame::RefreshSizeCache(nsBoxLayoutSta // If we don't have any HTML constraints and it's a resize, then nothing in the block // could have changed, so no refresh is necessary. nsBoxLayoutMetrics* metrics = BoxMetrics(); if (!DoesNeedRecalc(metrics->mBlockPrefSize)) return NS_OK; // the rect we plan to size to. - nsRect rect = GetRect(); + nsRect rect = GetPhysicalRect(); nsMargin bp(0,0,0,0); GetBorderAndPadding(bp); { // If we're a container for font size inflation, then shrink // wrapping inside of us should not apply font size inflation. AutoMaybeDisableFontInflation an(this); @@ -7798,17 +7798,17 @@ nsFrame::DoLayout(nsBoxLayoutState& aSta // ensure our size is what we think is should be. Someone could have // reset the frame to be smaller or something dumb like that. SetSize(ourRect.Size()); } } // Should we do this if IsCollapsed() is true? - nsSize size(GetSize()); + nsSize size(GetPhysicalSize()); desiredSize.width = size.width; desiredSize.height = size.height; desiredSize.UnionOverflowAreasWithDesiredBounds(); if (HasAbsolutelyPositionedChildren()) { // Set up a |reflowState| to pass into ReflowAbsoluteFrames nsHTMLReflowState reflowState(aState.PresContext(), this, aState.GetRenderingContext(), @@ -9246,17 +9246,17 @@ void nsFrame::DisplayLayoutExit(nsIFrame if (!DR_state->mActive) return; NS_ASSERTION(aFrame, "non-null frame required"); if (!aFrameTreeNode) return; DR_FrameTreeNode* treeNode = (DR_FrameTreeNode*)aFrameTreeNode; if (treeNode->mDisplay) { DR_state->DisplayFrameTypeInfo(aFrame, treeNode->mIndent); - nsRect rect = aFrame->GetRect(); + nsRect rect = aFrame->GetPhysicalRect(); printf("Layout=%d,%d,%d,%d\n", rect.x, rect.y, rect.width, rect.height); } DR_state->DeleteTreeNode(*treeNode); } void nsFrame::DisplayIntrinsicWidthExit(nsIFrame* aFrame, const char* aType, nscoord aResult, diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -631,17 +631,17 @@ nsHTMLScrollFrame::PlaceScrollArea(const // Using FinishAndStoreOverflow is needed so the overflow rect // gets set correctly. It also messes with the overflow rect in the // -moz-hidden-unscrollable case, but scrolled frames can't have // 'overflow' either. // This needs to happen before SyncFrameViewAfterReflow so // HasOverflowRect() will return the correct value. nsOverflowAreas overflow(scrolledArea, scrolledArea); scrolledFrame->FinishAndStoreOverflow(overflow, - scrolledFrame->GetSize()); + scrolledFrame->GetPhysicalSize()); // Note that making the view *exactly* the size of the scrolled area // is critical, since the view scrolling code uses the size of the // scrolled view to clamp scroll requests. // Normally the scrolledFrame won't have a view but in some cases it // might create its own. nsContainerFrame::SyncFrameViewAfterReflow(scrolledFrame->PresContext(), scrolledFrame, @@ -820,17 +820,17 @@ nsHTMLScrollFrame::Reflow(nsPresContext* aDesiredSize.width = state.mInsideBorderSize.width + state.mComputedBorder.LeftRight(); aDesiredSize.height = state.mInsideBorderSize.height + state.mComputedBorder.TopBottom(); aDesiredSize.SetOverflowAreasToDesiredBounds(); if (mInner.IsIgnoringViewportClipping()) { aDesiredSize.mOverflowAreas.UnionWith( - state.mContentsOverflowAreas + mInner.mScrolledFrame->GetPosition()); + state.mContentsOverflowAreas + mInner.mScrolledFrame->GetPhysicalPosition()); } mInner.UpdateSticky(); FinishReflowWithAbsoluteFrames(aPresContext, aDesiredSize, aReflowState, aStatus); if (!InInitialReflow() && !mInner.mHadNonInitialReflow) { mInner.mHadNonInitialReflow = true; } @@ -1696,17 +1696,17 @@ nsGfxScrollFrameInner::ScrollToWithOrigi // We can't use nsContainerFrame::PositionChildViews here because // we don't want to invalidate views that have moved. static void AdjustViews(nsIFrame* aFrame) { nsView* view = aFrame->GetView(); if (view) { nsPoint pt; aFrame->GetParent()->GetClosestView(&pt); - pt += aFrame->GetPosition(); + pt += aFrame->GetPhysicalPosition(); view->SetPosition(pt.x, pt.y); return; } if (!(aFrame->GetStateBits() & NS_FRAME_HAS_CHILD_WITH_VIEW)) { return; } @@ -1996,17 +1996,17 @@ nsGfxScrollFrameInner::ScrollToImpl(nsPo presContext->PresShell()->ScheduleImageVisibilityUpdate(); } // notify the listeners. for (uint32_t i = 0; i < mListeners.Length(); i++) { mListeners[i]->ScrollPositionWillChange(pt.x, pt.y); } - nsPoint oldScrollFramePos = mScrolledFrame->GetPosition(); + nsPoint oldScrollFramePos = mScrolledFrame->GetPhysicalPosition(); // Update frame position for scrolling mScrolledFrame->SetPosition(mScrollPort.TopLeft() - pt); // We pass in the amount to move visually ScrollVisual(oldScrollFramePos); ScheduleSyntheticMouseMove(); nsWeakFrame weakFrame(mOuter); @@ -2619,17 +2619,17 @@ static nsSize GetScrollPortSizeExcludingHeadersAndFooters(nsIFrame* aViewportFrame, const nsRect& aScrollPort) { nsTArray list; nsFrameList fixedFrames = aViewportFrame->GetChildList(nsIFrame::kFixedList); for (nsFrameList::Enumerator iterator(fixedFrames); !iterator.AtEnd(); iterator.Next()) { nsIFrame* f = iterator.get(); - nsRect r = f->GetRect().Intersect(aScrollPort); + nsRect r = f->GetPhysicalRect().Intersect(aScrollPort); if (r.x == 0 && r.width == aScrollPort.width && r.height <= aScrollPort.height/3) { list.AppendElement(TopAndBottom(r.y, r.YMost())); } } list.Sort(TopComparator()); nscoord headerBottom = 0; @@ -2702,17 +2702,17 @@ nsGfxScrollFrameInner::ScrollToRestoredP // if our desired position is different to the scroll position, scroll. // remember that we could be incrementally loading so we may enter // and scroll many times. if (mRestorePos != mLastPos /* GetLogicalScrollPosition() */) { nsPoint scrollToPos = mRestorePos; if (!IsLTR()) // convert from logical to physical scroll position scrollToPos.x = mScrollPort.x - - (mScrollPort.XMost() - scrollToPos.x - mScrolledFrame->GetRect().width); + (mScrollPort.XMost() - scrollToPos.x - mScrolledFrame->GetPhysicalRect().width); nsWeakFrame weakFrame(mOuter); ScrollTo(scrollToPos, nsIScrollableFrame::INSTANT); if (!weakFrame.IsAlive()) { return; } // Re-get the scroll position, it might not be exactly equal to // mRestorePos due to rounding and clamping. mLastPos = GetLogicalScrollPosition(); @@ -3290,17 +3290,17 @@ nsXULScrollFrame::LayoutScrollArea(nsBox if (minSize.width > childRect.width) childRect.width = minSize.width; aState.SetLayoutFlags(flags); ClampAndSetBounds(aState, childRect, aScrollPosition); mInner.mScrolledFrame->Layout(aState); - childRect = mInner.mScrolledFrame->GetRect(); + childRect = mInner.mScrolledFrame->GetPhysicalRect(); if (childRect.width < mInner.mScrollPort.width || childRect.height < mInner.mScrollPort.height) { childRect.width = std::max(childRect.width, mInner.mScrollPort.width); childRect.height = std::max(childRect.height, mInner.mScrollPort.height); // remove overflow areas when we update the bounds, @@ -3581,17 +3581,17 @@ nsXULScrollFrame::Layout(nsBoxLayoutStat } mInner.UpdateSticky(); // Set up overflow areas for block frames for the benefit of // text-overflow. nsIFrame* f = mInner.mScrolledFrame->GetContentInsertionFrame(); if (nsLayoutUtils::GetAsBlock(f)) { - nsRect origRect = f->GetRect(); + nsRect origRect = f->GetPhysicalRect(); nsRect clippedRect = origRect; clippedRect.MoveBy(mInner.mScrollPort.TopLeft()); clippedRect.IntersectRect(clippedRect, mInner.mScrollPort); nsOverflowAreas overflow = f->GetOverflowAreas(); f->FinishAndStoreOverflow(overflow, clippedRect.Size()); clippedRect.MoveTo(origRect.TopLeft()); f->SetRect(clippedRect); } @@ -3769,17 +3769,17 @@ nsGfxScrollFrameInner::AdjustScrollbarRe { if ((aVertical ? aRect.width : aRect.height) == 0) return; // if a content resizer is present, use its size. Otherwise, check if the // widget has a resizer. nsRect resizerRect; if (aHasResizer) { - resizerRect = mResizerBox->GetRect(); + resizerRect = mResizerBox->GetPhysicalRect(); } else { nsPoint offset; nsIWidget* widget = aFrame->GetNearestWidget(offset); nsIntRect widgetRect; if (!widget || !widget->ShowsResizeIndicator(&widgetRect)) return; @@ -4024,17 +4024,17 @@ nsGfxScrollFrameInner::GetBorderRadii(ns { if (!mOuter->nsContainerFrame::GetBorderRadii(aRadii)) return false; // Since we can use GetActualScrollbarSizes (rather than // GetDesiredScrollbarSizes) since this doesn't affect reflow, we // probably should. nsMargin sb = GetActualScrollbarSizes(); - nsMargin border = mOuter->GetUsedBorder(); + nsMargin border = mOuter->GetUsedPhysicalBorder(); if (sb.left > 0 || sb.top > 0) { ReduceRadii(border.left, border.top, aRadii[NS_CORNER_TOP_LEFT_X], aRadii[NS_CORNER_TOP_LEFT_Y]); } if (sb.top > 0 || sb.right > 0) { @@ -4081,17 +4081,17 @@ nsGfxScrollFrameInner::GetScrolledRectIn return nsLayoutUtils::GetScrolledRect(mScrolledFrame, aScrolledFrameOverflowArea, aScrollPortSize, IsLTR() ? NS_STYLE_DIRECTION_LTR : NS_STYLE_DIRECTION_RTL); } nsMargin nsGfxScrollFrameInner::GetActualScrollbarSizes() const { - nsRect r = mOuter->GetPaddingRect() - mOuter->GetPosition(); + nsRect r = mOuter->GetPaddingRect() - mOuter->GetPhysicalPosition(); return nsMargin(mScrollPort.y - r.y, r.XMost() - mScrollPort.XMost(), r.YMost() - mScrollPort.YMost(), mScrollPort.x - r.x); } void diff --git a/layout/generic/nsGfxScrollFrame.h b/layout/generic/nsGfxScrollFrame.h --- a/layout/generic/nsGfxScrollFrame.h +++ b/layout/generic/nsGfxScrollFrame.h @@ -143,31 +143,31 @@ public: /** * @note This method might destroy the frame, pres shell and other objects. * Update scrollbar curpos attributes to reflect current scroll position */ void UpdateScrollbarPosition(); nsRect GetScrollPortRect() const { return mScrollPort; } nsPoint GetScrollPosition() const { - return mScrollPort.TopLeft() - mScrolledFrame->GetPosition(); + return mScrollPort.TopLeft() - mScrolledFrame->GetPhysicalPosition(); } /** * For LTR frames, the logical scroll position is the offset of the top left * corner of the frame from the top left corner of the scroll port (same as * GetScrollPosition). * For RTL frames, it is the offset of the top right corner of the frame from * the top right corner of the scroll port */ nsPoint GetLogicalScrollPosition() const { nsPoint pt; pt.x = IsLTR() ? - mScrollPort.x - mScrolledFrame->GetPosition().x : - mScrollPort.XMost() - mScrolledFrame->GetRect().XMost(); - pt.y = mScrollPort.y - mScrolledFrame->GetPosition().y; + mScrollPort.x - mScrolledFrame->GetPhysicalPosition().x : + mScrollPort.XMost() - mScrolledFrame->GetPhysicalRect().XMost(); + pt.y = mScrollPort.y - mScrolledFrame->GetPhysicalPosition().y; return pt; } nsRect GetScrollRange() const; // Get the scroll range assuming the scrollport has size (aWidth, aHeight). nsRect GetScrollRange(nscoord aWidth, nscoord aHeight) const; nsSize GetScrollPositionClampingScrollPortSize() const; protected: nsRect GetScrollRangeForClamping() const; @@ -500,17 +500,17 @@ public: virtual nsIFrame* GetContentInsertionFrame() MOZ_OVERRIDE { return mInner.GetScrolledFrame()->GetContentInsertionFrame(); } virtual bool DoesClipChildren() MOZ_OVERRIDE { return true; } virtual nsSplittableType GetSplittableType() const MOZ_OVERRIDE; virtual nsPoint GetPositionOfChildIgnoringScrolling(nsIFrame* aChild) MOZ_OVERRIDE - { nsPoint pt = aChild->GetPosition(); + { nsPoint pt = aChild->GetPhysicalPosition(); if (aChild == mInner.GetScrolledFrame()) pt += GetScrollPosition(); return pt; } // nsIAnonymousContentCreator virtual nsresult CreateAnonymousContent(nsTArray& aElements) MOZ_OVERRIDE; virtual void AppendAnonymousContentTo(nsBaseContentList& aElements, uint32_t aFilter) MOZ_OVERRIDE; @@ -754,17 +754,17 @@ public: virtual nsIFrame* GetContentInsertionFrame() MOZ_OVERRIDE { return mInner.GetScrolledFrame()->GetContentInsertionFrame(); } virtual bool DoesClipChildren() MOZ_OVERRIDE { return true; } virtual nsSplittableType GetSplittableType() const MOZ_OVERRIDE; virtual nsPoint GetPositionOfChildIgnoringScrolling(nsIFrame* aChild) MOZ_OVERRIDE - { nsPoint pt = aChild->GetPosition(); + { nsPoint pt = aChild->GetPhysicalPosition(); if (aChild == mInner.GetScrolledFrame()) pt += mInner.GetLogicalScrollPosition(); return pt; } // nsIAnonymousContentCreator virtual nsresult CreateAnonymousContent(nsTArray& aElements) MOZ_OVERRIDE; virtual void AppendAnonymousContentTo(nsBaseContentList& aElements, diff --git a/layout/generic/nsHTMLCanvasFrame.cpp b/layout/generic/nsHTMLCanvasFrame.cpp --- a/layout/generic/nsHTMLCanvasFrame.cpp +++ b/layout/generic/nsHTMLCanvasFrame.cpp @@ -236,17 +236,17 @@ nsHTMLCanvasFrame::GetInnerArea() const } already_AddRefed nsHTMLCanvasFrame::BuildLayer(nsDisplayListBuilder* aBuilder, LayerManager* aManager, nsDisplayItem* aItem, const ContainerParameters& aContainerParameters) { - nsRect area = GetContentRect() - GetPosition() + aItem->ToReferenceFrame(); + nsRect area = GetContentRect() - GetPhysicalPosition() + aItem->ToReferenceFrame(); HTMLCanvasElement* element = static_cast(GetContent()); nsIntSize canvasSize = GetCanvasSize(); nsPresContext* presContext = PresContext(); element->HandlePrintCallback(presContext->Type()); if (canvasSize.width <= 0 || canvasSize.height <= 0 || area.IsEmpty()) return nullptr; @@ -306,17 +306,17 @@ nsHTMLCanvasFrame::GetContinuationOffset { nscoord offset = 0; if (aWidth) { *aWidth = 0; } if (GetPrevInFlow()) { for (nsIFrame* prevInFlow = GetPrevInFlow() ; prevInFlow; prevInFlow = prevInFlow->GetPrevInFlow()) { - nsRect rect = prevInFlow->GetRect(); + nsRect rect = prevInFlow->GetPhysicalRect(); if (aWidth) { *aWidth = rect.width; } offset += rect.height; } offset -= mBorderPadding.top; offset = std::max(0, offset); } diff --git a/layout/generic/nsHTMLReflowState.cpp b/layout/generic/nsHTMLReflowState.cpp --- a/layout/generic/nsHTMLReflowState.cpp +++ b/layout/generic/nsHTMLReflowState.cpp @@ -425,17 +425,17 @@ IsQuirkContainingBlockHeight(const nsHTM } return true; } void nsHTMLReflowState::InitResizeFlags(nsPresContext* aPresContext, nsIAtom* aFrameType) { - bool isHResize = (frame->GetSize().width != + bool isHResize = (frame->GetPhysicalSize().width != mComputedWidth + mComputedBorderPadding.LeftRight()) || aPresContext->PresShell()->IsReflowOnZoomPending(); if ((frame->GetStateBits() & NS_FRAME_FONT_INFLATION_FLOW_ROOT) && nsLayoutUtils::FontSizeInflationEnabled(aPresContext)) { // Create our font inflation data if we don't have it already, and // give it our current width information. bool dirty = nsFontInflationData::UpdateFontInflationDataWidthFor(*this) && @@ -545,17 +545,17 @@ nsHTMLReflowState::InitResizeFlags(nsPre mCBReflowState) { mFlags.mVResize = mCBReflowState->mFlags.mVResize; } else { mFlags.mVResize = mFlags.mHResize; } mFlags.mVResize = mFlags.mVResize || NS_SUBTREE_DIRTY(frame); } else { // not 'auto' height - mFlags.mVResize = frame->GetSize().height != + mFlags.mVResize = frame->GetPhysicalSize().height != mComputedHeight + mComputedBorderPadding.TopBottom(); } bool dependsOnCBHeight = (mStylePosition->HeightDependsOnContainer() && // FIXME: condition this on not-abspos? mStylePosition->mHeight.GetUnit() != eStyleUnit_Auto) || mStylePosition->MinHeightDependsOnContainer() || @@ -913,19 +913,19 @@ nsHTMLReflowState::GetHypotheticalBoxCon aCBLeftEdge = state->mComputedBorderPadding.left; aCBWidth = state->mComputedWidth; } else { /* Didn't find a reflow state for aFrame. Just compute the information we want, on the assumption that aFrame already knows its size. This really ought to be true by now. */ NS_ASSERTION(!(aFrame->GetStateBits() & NS_FRAME_IN_REFLOW), "aFrame shouldn't be in reflow; we'll lie if it is"); - nsMargin borderPadding = aFrame->GetUsedBorderAndPadding(); + nsMargin borderPadding = aFrame->GetUsedPhysicalBorderAndPadding(); aCBLeftEdge = borderPadding.left; - aCBWidth = aFrame->GetSize().width - borderPadding.LeftRight(); + aCBWidth = aFrame->GetPhysicalSize().width - borderPadding.LeftRight(); } return aFrame; } // When determining the hypothetical box that would have been if the element // had been in the flow we may not be able to exactly determine both the left // and right edges. For example, if the element is a non-replaced inline-level @@ -1770,21 +1770,21 @@ nsHTMLReflowState::ComputeContainingBloc // Base our size on the actual size of the frame. In cases when this is // completely bogus (eg initial reflow), this code shouldn't even be // called, since the code in nsInlineFrame::Reflow will pass in // the containing block dimensions to our constructor. // XXXbz we should be taking the in-flows into account too, but // that's very hard. nsMargin computedBorder = aContainingBlockRS->mComputedBorderPadding - aContainingBlockRS->mComputedPadding; - aContainingBlockWidth = aContainingBlockRS->frame->GetRect().width - + aContainingBlockWidth = aContainingBlockRS->frame->GetPhysicalRect().width - computedBorder.LeftRight(); NS_ASSERTION(aContainingBlockWidth >= 0, "Negative containing block width!"); - aContainingBlockHeight = aContainingBlockRS->frame->GetRect().height - + aContainingBlockHeight = aContainingBlockRS->frame->GetPhysicalRect().height - computedBorder.TopBottom(); NS_ASSERTION(aContainingBlockHeight >= 0, "Negative containing block height!"); } else { // If the ancestor is block-level, the containing block is formed by the // padding edge of the ancestor aContainingBlockWidth += aContainingBlockRS->mComputedPadding.LeftRight(); aContainingBlockHeight += aContainingBlockRS->mComputedPadding.TopBottom(); @@ -2167,17 +2167,17 @@ nsCSSOffsetState::InitOffsets(nscoord aH // Compute margins from the specified margin style information. These // become the default computed values, and may be adjusted below // XXX fix to provide 0,0 for the top&bottom margins for // inline-non-replaced elements bool needMarginProp = ComputeMargin(aHorizontalPercentBasis, aVerticalPercentBasis); // XXX We need to include 'auto' horizontal margins in this too! - // ... but if we did that, we'd need to fix nsFrame::GetUsedMargin + // ... but if we did that, we'd need to fix nsFrame::GetUsedPhysicalMargin // to use it even when the margins are all zero (since sometimes // they get treated as auto) ::UpdateProp(props, nsIFrame::UsedMarginProperty(), needMarginProp, mComputedMargin); const nsStyleDisplay *disp = frame->StyleDisplay(); bool isThemed = frame->IsThemed(disp); @@ -2245,17 +2245,17 @@ nsCSSOffsetState::InitOffsets(nscoord aH // The margin is inherited to the outer table frame via // the ::-moz-table-outer rule in ua.css. mComputedMargin.SizeTo(0, 0, 0, 0); } else if (aFrameType == nsGkAtoms::scrollbarFrame) { // scrollbars may have had their width or height smashed to zero // by the associated scrollframe, in which case we must not report // any padding or border. - nsSize size(frame->GetSize()); + nsSize size(frame->GetPhysicalSize()); if (size.width == 0 || size.height == 0) { mComputedPadding.SizeTo(0,0,0,0); mComputedBorderPadding.SizeTo(0,0,0,0); } } ::UpdateProp(props, nsIFrame::UsedPaddingProperty(), needPaddingProp, mComputedPadding); } diff --git a/layout/generic/nsIFrame.h b/layout/generic/nsIFrame.h --- a/layout/generic/nsIFrame.h +++ b/layout/generic/nsIFrame.h @@ -836,19 +836,19 @@ public: /** * Bounding rect of the frame. The values are in app units, and the origin is * relative to the upper-left of the geometric parent. The size includes the * content area, borders, and padding. * * Note: moving or sizing the frame does not affect the view's size or * position. */ - nsRect GetRect() const { return mRect; } - nsPoint GetPosition() const { return mRect.TopLeft(); } - nsSize GetSize() const { return mRect.Size(); } + nsRect GetPhysicalRect() const { return mRect; } + nsPoint GetPhysicalPosition() const { return mRect.TopLeft(); } + nsSize GetPhysicalSize() const { return mRect.Size(); } /** * When we change the size of the frame's border-box rect, we may need to * reset the overflow rect if it was previously stored as deltas. * (If it is currently a "large" overflow and could be re-packed as deltas, * we don't bother as the cost of the allocation has already been paid.) */ void SetRect(const nsRect& aRect) { @@ -864,37 +864,37 @@ public: void SetSize(const nsSize& aSize) { SetRect(nsRect(mRect.TopLeft(), aSize)); } void SetPosition(const nsPoint& aPt) { mRect.MoveTo(aPt); } /** * Move the frame, accounting for relative positioning. Use this when * adjusting the frame's position by a known amount, to properly update its - * saved normal position (see GetNormalPosition below). + * saved normal position (see GetNormalPhysicalPosition below). * * This must be used only when moving a frame *after* * nsHTMLReflowState::ApplyRelativePositioning is called. When moving * a frame during the reflow process prior to calling * nsHTMLReflowState::ApplyRelativePositioning, the position should * simply be adjusted directly (e.g., using SetPosition()). */ void MovePositionBy(const nsPoint& aTranslation); /** * Return frame's position without relative positioning */ - nsPoint GetNormalPosition() const; + nsPoint GetNormalPhysicalPosition() const; virtual nsPoint GetPositionOfChildIgnoringScrolling(nsIFrame* aChild) - { return aChild->GetPosition(); } + { return aChild->GetPhysicalPosition(); } nsPoint GetPositionIgnoringScrolling() { return mParent ? mParent->GetPositionOfChildIgnoringScrolling(this) - : GetPosition(); + : GetPhysicalPosition(); } static void DestroyRegion(void* aPropertyValue); static void DestroyMargin(void* aPropertyValue) { delete static_cast(aPropertyValue); } @@ -961,48 +961,48 @@ public: NS_DECLARE_FRAME_PROPERTY(LineBaselineOffset, nullptr) NS_DECLARE_FRAME_PROPERTY(CachedBackgroundImage, DestroySurface) NS_DECLARE_FRAME_PROPERTY(InvalidationRect, DestroyRect) /** * Return the distance between the border edge of the frame and the - * margin edge of the frame. Like GetRect(), returns the dimensions + * margin edge of the frame. Like GetPhysicalRect(), returns the dimensions * as of the most recent reflow. * * This doesn't include any margin collapsing that may have occurred. * * It also treats 'auto' margins as zero, and treats any margins that * should have been turned into 'auto' because of overconstraint as * having their original values. */ - virtual nsMargin GetUsedMargin() const; + virtual nsMargin GetUsedPhysicalMargin() const; /** * Return the distance between the border edge of the frame (which is - * its rect) and the padding edge of the frame. Like GetRect(), returns + * its rect) and the padding edge of the frame. Like GetPhysicalRect(), returns * the dimensions as of the most recent reflow. * * Note that this differs from StyleBorder()->GetBorder() in that * this describes region of the frame's box, and * StyleBorder()->GetBorder() describes a border. They differ only * for tables, particularly border-collapse tables. */ - virtual nsMargin GetUsedBorder() const; + virtual nsMargin GetUsedPhysicalBorder() const; /** * Return the distance between the padding edge of the frame and the - * content edge of the frame. Like GetRect(), returns the dimensions + * content edge of the frame. Like GetPhysicalRect(), returns the dimensions * as of the most recent reflow. */ - virtual nsMargin GetUsedPadding() const; - - nsMargin GetUsedBorderAndPadding() const { - return GetUsedBorder() + GetUsedPadding(); + virtual nsMargin GetUsedPhysicalPadding() const; + + nsMargin GetUsedPhysicalBorderAndPadding() const { + return GetUsedPhysicalBorder() + GetUsedPhysicalPadding(); } /** * Apply the result of GetSkipSides() on this frame to an nsMargin by * setting to zero any sides that are skipped. * * @param aMargin The margin to apply the result of GetSkipSides() to. * @param aReflowState An optional reflow state parameter, which is used if @@ -1015,17 +1015,17 @@ public: * lieu of this, during reflow, an nsHTMLReflowState parameter can be * passed in, indicating that it should be used to determine if sides * should be skipped during reflow. */ void ApplySkipSides(nsMargin& aMargin, const nsHTMLReflowState* aReflowState = nullptr) const; /** - * Like the frame's rect (see |GetRect|), which is the border rect, + * Like the frame's rect (see |GetPhysicalRect|), which is the border rect, * other rectangles of the frame, in app units, relative to the parent. */ nsRect GetPaddingRect() const; nsRect GetPaddingRectRelativeToSelf() const; nsRect GetContentRect() const; nsRect GetContentRectRelativeToSelf() const; /** diff --git a/layout/generic/nsImageFrame.cpp b/layout/generic/nsImageFrame.cpp --- a/layout/generic/nsImageFrame.cpp +++ b/layout/generic/nsImageFrame.cpp @@ -745,17 +745,17 @@ nsImageFrame::ComputeSize(nsRenderingCon aRenderingContext, this, mIntrinsicSize, mIntrinsicRatio, aCBSize, aMargin, aBorder, aPadding); } nsRect nsImageFrame::GetInnerArea() const { - return GetContentRect() - GetPosition(); + return GetContentRect() - GetPhysicalPosition(); } // get the offset into the content area of the image where aImg starts if it is a continuation. nscoord nsImageFrame::GetContinuationOffset() const { nscoord offset = 0; for (nsIFrame *f = GetPrevInFlow(); f; f = f->GetPrevInFlow()) { @@ -839,17 +839,17 @@ nsImageFrame::Reflow(nsPresContext* aMetrics.width = mComputedSize.width; aMetrics.height = mComputedSize.height; // add borders and padding aMetrics.width += aReflowState.mComputedBorderPadding.LeftRight(); aMetrics.height += aReflowState.mComputedBorderPadding.TopBottom(); if (GetPrevInFlow()) { - aMetrics.width = GetPrevInFlow()->GetSize().width; + aMetrics.width = GetPrevInFlow()->GetPhysicalSize().width; nscoord y = GetContinuationOffset(); aMetrics.height -= y + aReflowState.mComputedBorderPadding.top; aMetrics.height = std::max(0, aMetrics.height); } // we have to split images if we are: // in Paginated mode, we need to have a constrained height, and have a height larger than our available height diff --git a/layout/generic/nsImageFrame.h b/layout/generic/nsImageFrame.h --- a/layout/generic/nsImageFrame.h +++ b/layout/generic/nsImageFrame.h @@ -386,17 +386,17 @@ public: gfxRect GetDestRect(); virtual LayerState GetLayerState(nsDisplayListBuilder* aBuilder, LayerManager* aManager, const ContainerParameters& aParameters) MOZ_OVERRIDE; virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap) MOZ_OVERRIDE { *aSnap = true; - return nsRect(ToReferenceFrame(), Frame()->GetSize()); + return nsRect(ToReferenceFrame(), Frame()->GetPhysicalSize()); } virtual already_AddRefed BuildLayer(nsDisplayListBuilder* aBuilder, LayerManager* aManager, const ContainerParameters& aContainerParameters) MOZ_OVERRIDE; /** * Configure an ImageLayer for this display item. diff --git a/layout/generic/nsImageMap.cpp b/layout/generic/nsImageMap.cpp --- a/layout/generic/nsImageMap.cpp +++ b/layout/generic/nsImageMap.cpp @@ -31,17 +31,17 @@ class Area { public: Area(nsIContent* aArea); virtual ~Area(); virtual void ParseCoords(const nsAString& aSpec); virtual bool IsInside(nscoord x, nscoord y) const = 0; virtual void Draw(nsIFrame* aFrame, nsRenderingContext& aRC) = 0; - virtual void GetRect(nsIFrame* aFrame, nsRect& aRect) = 0; + virtual void GetPhysicalRect(nsIFrame* aFrame, nsRect& aRect) = 0; void HasFocus(bool aHasFocus); nsCOMPtr mArea; nscoord* mCoords; int32_t mNumCoords; bool mHasFocus; }; @@ -263,63 +263,63 @@ void Area::HasFocus(bool aHasFocus) //---------------------------------------------------------------------- class DefaultArea : public Area { public: DefaultArea(nsIContent* aArea); virtual bool IsInside(nscoord x, nscoord y) const; virtual void Draw(nsIFrame* aFrame, nsRenderingContext& aRC); - virtual void GetRect(nsIFrame* aFrame, nsRect& aRect); + virtual void GetPhysicalRect(nsIFrame* aFrame, nsRect& aRect); }; DefaultArea::DefaultArea(nsIContent* aArea) : Area(aArea) { } bool DefaultArea::IsInside(nscoord x, nscoord y) const { return true; } void DefaultArea::Draw(nsIFrame* aFrame, nsRenderingContext& aRC) { if (mHasFocus) { - nsRect r = aFrame->GetRect(); + nsRect r = aFrame->GetPhysicalRect(); r.MoveTo(0, 0); nscoord x1 = r.x; nscoord y1 = r.y; const nscoord kOnePixel = nsPresContext::CSSPixelsToAppUnits(1); nscoord x2 = r.XMost() - kOnePixel; nscoord y2 = r.YMost() - kOnePixel; // XXX aRC.DrawRect(r) result is ugly, that's why we use DrawLine. aRC.DrawLine(x1, y1, x1, y2); aRC.DrawLine(x1, y2, x2, y2); aRC.DrawLine(x1, y1, x2, y1); aRC.DrawLine(x2, y1, x2, y2); } } -void DefaultArea::GetRect(nsIFrame* aFrame, nsRect& aRect) +void DefaultArea::GetPhysicalRect(nsIFrame* aFrame, nsRect& aRect) { - aRect = aFrame->GetRect(); + aRect = aFrame->GetPhysicalRect(); aRect.MoveTo(0, 0); } //---------------------------------------------------------------------- class RectArea : public Area { public: RectArea(nsIContent* aArea); virtual void ParseCoords(const nsAString& aSpec); virtual bool IsInside(nscoord x, nscoord y) const; virtual void Draw(nsIFrame* aFrame, nsRenderingContext& aRC); - virtual void GetRect(nsIFrame* aFrame, nsRect& aRect); + virtual void GetPhysicalRect(nsIFrame* aFrame, nsRect& aRect); }; RectArea::RectArea(nsIContent* aArea) : Area(aArea) { } void RectArea::ParseCoords(const nsAString& aSpec) @@ -388,17 +388,17 @@ void RectArea::Draw(nsIFrame* aFrame, ns aRC.DrawLine(x1, y1, x1, y2); aRC.DrawLine(x1, y2, x2, y2); aRC.DrawLine(x1, y1, x2, y1); aRC.DrawLine(x2, y1, x2, y2); } } } -void RectArea::GetRect(nsIFrame* aFrame, nsRect& aRect) +void RectArea::GetPhysicalRect(nsIFrame* aFrame, nsRect& aRect) { if (mNumCoords >= 4) { nscoord x1 = nsPresContext::CSSPixelsToAppUnits(mCoords[0]); nscoord y1 = nsPresContext::CSSPixelsToAppUnits(mCoords[1]); nscoord x2 = nsPresContext::CSSPixelsToAppUnits(mCoords[2]); nscoord y2 = nsPresContext::CSSPixelsToAppUnits(mCoords[3]); NS_ASSERTION(x1 <= x2 && y1 <= y2, "Someone screwed up RectArea::ParseCoords"); @@ -411,17 +411,17 @@ void RectArea::GetRect(nsIFrame* aFrame, class PolyArea : public Area { public: PolyArea(nsIContent* aArea); virtual void ParseCoords(const nsAString& aSpec); virtual bool IsInside(nscoord x, nscoord y) const; virtual void Draw(nsIFrame* aFrame, nsRenderingContext& aRC); - virtual void GetRect(nsIFrame* aFrame, nsRect& aRect); + virtual void GetPhysicalRect(nsIFrame* aFrame, nsRect& aRect); }; PolyArea::PolyArea(nsIContent* aArea) : Area(aArea) { } void PolyArea::ParseCoords(const nsAString& aSpec) @@ -523,17 +523,17 @@ void PolyArea::Draw(nsIFrame* aFrame, ns } x1 = nsPresContext::CSSPixelsToAppUnits(mCoords[0]); y1 = nsPresContext::CSSPixelsToAppUnits(mCoords[1]); aRC.DrawLine(x0, y0, x1, y1); } } } -void PolyArea::GetRect(nsIFrame* aFrame, nsRect& aRect) +void PolyArea::GetPhysicalRect(nsIFrame* aFrame, nsRect& aRect) { if (mNumCoords >= 6) { nscoord x1, x2, y1, y2, xtmp, ytmp; x1 = x2 = nsPresContext::CSSPixelsToAppUnits(mCoords[0]); y1 = y2 = nsPresContext::CSSPixelsToAppUnits(mCoords[1]); for (int32_t i = 2; i < mNumCoords; i += 2) { xtmp = nsPresContext::CSSPixelsToAppUnits(mCoords[i]); ytmp = nsPresContext::CSSPixelsToAppUnits(mCoords[i+1]); @@ -551,17 +551,17 @@ void PolyArea::GetRect(nsIFrame* aFrame, class CircleArea : public Area { public: CircleArea(nsIContent* aArea); virtual void ParseCoords(const nsAString& aSpec); virtual bool IsInside(nscoord x, nscoord y) const; virtual void Draw(nsIFrame* aFrame, nsRenderingContext& aRC); - virtual void GetRect(nsIFrame* aFrame, nsRect& aRect); + virtual void GetPhysicalRect(nsIFrame* aFrame, nsRect& aRect); }; CircleArea::CircleArea(nsIContent* aArea) : Area(aArea) { } void CircleArea::ParseCoords(const nsAString& aSpec) @@ -627,17 +627,17 @@ void CircleArea::Draw(nsIFrame* aFrame, nscoord x = x1 - radius; nscoord y = y1 - radius; nscoord w = 2 * radius; aRC.DrawEllipse(x, y, w, w); } } } -void CircleArea::GetRect(nsIFrame* aFrame, nsRect& aRect) +void CircleArea::GetPhysicalRect(nsIFrame* aFrame, nsRect& aRect) { if (mNumCoords >= 3) { nscoord x1 = nsPresContext::CSSPixelsToAppUnits(mCoords[0]); nscoord y1 = nsPresContext::CSSPixelsToAppUnits(mCoords[1]); nscoord radius = nsPresContext::CSSPixelsToAppUnits(mCoords[2]); if (radius < 0) { return; } @@ -671,17 +671,17 @@ nsImageMap::GetBoundsForAreaContent(nsIC NS_ENSURE_TRUE(aContent && mImageFrame, NS_ERROR_INVALID_ARG); // Find the Area struct associated with this content node, and return bounds uint32_t i, n = mAreas.Length(); for (i = 0; i < n; i++) { Area* area = mAreas.ElementAt(i); if (area->mArea == aContent) { aBounds = nsRect(); - area->GetRect(mImageFrame, aBounds); + area->GetPhysicalRect(mImageFrame, aBounds); return NS_OK; } } return NS_ERROR_FAILURE; } void nsImageMap::FreeAreas() diff --git a/layout/generic/nsLineBox.cpp b/layout/generic/nsLineBox.cpp --- a/layout/generic/nsLineBox.cpp +++ b/layout/generic/nsLineBox.cpp @@ -720,31 +720,31 @@ nsLineIterator::FindFrameAt(int32_t aLin if (line->mBounds.width == 0 && line->mBounds.height == 0) return NS_ERROR_FAILURE; nsIFrame* frame = line->mFirstChild; nsIFrame* closestFromLeft = nullptr; nsIFrame* closestFromRight = nullptr; int32_t n = line->GetChildCount(); while (n--) { - nsRect rect = frame->GetRect(); + nsRect rect = frame->GetPhysicalRect(); if (rect.width > 0) { // If aX is inside this frame - this is it if (rect.x <= aX && rect.XMost() > aX) { closestFromLeft = closestFromRight = frame; break; } if (rect.x < aX) { if (!closestFromLeft || - rect.XMost() > closestFromLeft->GetRect().XMost()) + rect.XMost() > closestFromLeft->GetPhysicalRect().XMost()) closestFromLeft = frame; } else { if (!closestFromRight || - rect.x < closestFromRight->GetRect().x) + rect.x < closestFromRight->GetPhysicalRect().x) closestFromRight = frame; } } frame = frame->GetNextSibling(); } if (!closestFromLeft && !closestFromRight) { // All frames were zero-width. Just take the first one. closestFromLeft = closestFromRight = line->mFirstChild; @@ -756,18 +756,18 @@ nsLineIterator::FindFrameAt(int32_t aLin } else if (!closestFromLeft) { *aFrameFound = closestFromRight; } else if (!closestFromRight) { *aFrameFound = closestFromLeft; } else { // we're between two frames - nscoord delta = closestFromRight->GetRect().x - closestFromLeft->GetRect().XMost(); - if (aX < closestFromLeft->GetRect().XMost() + delta/2) + nscoord delta = closestFromRight->GetPhysicalRect().x - closestFromLeft->GetPhysicalRect().XMost(); + if (aX < closestFromLeft->GetPhysicalRect().XMost() + delta/2) *aFrameFound = closestFromLeft; else *aFrameFound = closestFromRight; } return NS_OK; } NS_IMETHODIMP diff --git a/layout/generic/nsLineLayout.cpp b/layout/generic/nsLineLayout.cpp --- a/layout/generic/nsLineLayout.cpp +++ b/layout/generic/nsLineLayout.cpp @@ -1329,17 +1329,17 @@ nsLineLayout::AddBulletFrame(nsIFrame* a pfd->mFlags = 0; // all flags default to false pfd->SetFlag(PFD_ISBULLET, true); if (aMetrics.ascent == nsHTMLReflowMetrics::ASK_FOR_BASELINE) pfd->mAscent = aFrame->GetBaseline(); else pfd->mAscent = aMetrics.ascent; // Note: y value will be updated during vertical alignment - pfd->mBounds = aFrame->GetRect(); + pfd->mBounds = aFrame->GetPhysicalRect(); pfd->mOverflowAreas = aMetrics.mOverflowAreas; } #ifdef DEBUG void nsLineLayout::DumpPerSpanData(PerSpanData* psd, int32_t aIndent) { nsFrame::IndentBy(stdout, aIndent); @@ -2195,17 +2195,17 @@ nsLineLayout::VerticalAlignFrames(PerSpa } static void SlideSpanFrameRect(nsIFrame* aFrame, nscoord aDeltaWidth) { // This should not use nsIFrame::MovePositionBy because it happens // prior to relative positioning. In particular, because // nsBlockFrame::PlaceLine calls aLineLayout.TrimTrailingWhiteSpace() // prior to calling aLineLayout.RelativePositionFrames(). - nsPoint p = aFrame->GetPosition(); + nsPoint p = aFrame->GetPhysicalPosition(); p.x -= aDeltaWidth; aFrame->SetPosition(p); } bool nsLineLayout::TrimTrailingWhiteSpaceIn(PerSpanData* psd, nscoord* aDeltaWidth) { @@ -2243,17 +2243,17 @@ nsLineLayout::TrimTrailingWhiteSpaceIn(P if (psd != mRootSpan) { // When the child span is not a direct child of the block // we need to update the child spans frame rectangle // because it most likely will not be done again. Spans // that are direct children of the block will be updated // later, however, because the VerticalAlignFrames method // will be run after this method. nsIFrame* f = pfd->mFrame; - nsRect r = f->GetRect(); + nsRect r = f->GetPhysicalRect(); r.width -= deltaWidth; f->SetRect(r); } // Adjust the right edge of the span that contains the child span psd->mX -= deltaWidth; // Slide any frames that follow the child span over by the @@ -2590,17 +2590,17 @@ nsLineLayout::RelativePositionFrames(Per // -- pfd->mOverflowAreas, which is the area of a bullet or the union // of a relatively positioned frame's absolute children // -- the bounds of all inline descendants // The former two parts are computed right here, we gather the descendants // below. // At this point psd->mFrame->mBounds might be out of date since // bidi reordering can move and resize the frames. So use the frame's // rect instead of mBounds. - nsRect adjustedBounds(nsPoint(0, 0), psd->mFrame->mFrame->GetSize()); + nsRect adjustedBounds(nsPoint(0, 0), psd->mFrame->mFrame->GetPhysicalSize()); overflowAreas.ScrollableOverflow().UnionRect( psd->mFrame->mOverflowAreas.ScrollableOverflow(), adjustedBounds); overflowAreas.VisualOverflow().UnionRect( psd->mFrame->mOverflowAreas.VisualOverflow(), adjustedBounds); } else { // The minimum combined area for the frames that are direct @@ -2615,17 +2615,17 @@ nsLineLayout::RelativePositionFrames(Per overflowAreas.VisualOverflow().y = mTopEdge; overflowAreas.VisualOverflow().height = mFinalLineHeight; overflowAreas.ScrollableOverflow() = overflowAreas.VisualOverflow(); } for (PerFrameData* pfd = psd->mFirstFrame; pfd; pfd = pfd->mNext) { nsIFrame* frame = pfd->mFrame; - nsPoint origin = frame->GetPosition(); + nsPoint origin = frame->GetPhysicalPosition(); // Adjust the origin of the frame if (pfd->GetFlag(PFD_RELATIVEPOS)) { // right and bottom are handled by // nsHTMLReflowState::ComputeRelativeOffsets nsHTMLReflowState::ApplyRelativePositioning(pfd->mFrame, pfd->mOffsets, &origin); @@ -2656,17 +2656,17 @@ nsLineLayout::RelativePositionFrames(Per // (1) When PFD_RECOMPUTEOVERFLOW is set due to trimming // (2) When there are text decorations, since we can't recompute the // overflow area until Reflow and VerticalAlignLine have finished if (pfd->GetFlag(PFD_RECOMPUTEOVERFLOW) || frame->StyleContext()->HasTextDecorationLines()) { nsTextFrame* f = static_cast(frame); r = f->RecomputeOverflow(*mBlockReflowState); } - frame->FinishAndStoreOverflow(r, frame->GetSize()); + frame->FinishAndStoreOverflow(r, frame->GetPhysicalSize()); } // If we have something that's not an inline but with a complex frame // hierarchy inside that contains views, they need to be // positioned. // All descendant views must be repositioned even if this frame // does have a view in case this frame's view does not have a // widget and some of the descendant views do have widgets -- @@ -2686,12 +2686,12 @@ nsLineLayout::RelativePositionFrames(Per overflowAreas.UnionWith(r + origin); } // If we just computed a spans combined area, we need to update its // overflow rect... if (psd->mFrame) { PerFrameData* spanPFD = psd->mFrame; nsIFrame* frame = spanPFD->mFrame; - frame->FinishAndStoreOverflow(overflowAreas, frame->GetSize()); + frame->FinishAndStoreOverflow(overflowAreas, frame->GetPhysicalSize()); } aOverflowAreas = overflowAreas; } diff --git a/layout/generic/nsLineLayout.h b/layout/generic/nsLineLayout.h --- a/layout/generic/nsLineLayout.h +++ b/layout/generic/nsLineLayout.h @@ -298,17 +298,17 @@ public: /** * Returns the accumulated advance width of frames before the current frame * on the line, plus the line container's left border+padding. * This is always positive, the advance width is measured from * the right edge for RTL blocks and from the left edge for LTR blocks. * In other words, the current frame's distance from the line container's * start content edge is: - * GetCurrentFrameXDistanceFromBlock() - lineContainer->GetUsedBorderAndPadding().left + * GetCurrentFrameXDistanceFromBlock() - lineContainer->GetUsedPhysicalBorderAndPadding().left * Note the use of .left for both LTR and RTL line containers. */ nscoord GetCurrentFrameXDistanceFromBlock(); protected: // This state is constant for a given block frame doing line layout nsFloatManager* mFloatManager; const nsStyleText* mStyleText; // for the block diff --git a/layout/generic/nsPageFrame.cpp b/layout/generic/nsPageFrame.cpp --- a/layout/generic/nsPageFrame.cpp +++ b/layout/generic/nsPageFrame.cpp @@ -474,32 +474,32 @@ nsPageFrame::BuildDisplayList(nsDisplayL nsDisplayListCollection set; if (PresContext()->IsScreen()) { DisplayBorderBackgroundOutline(aBuilder, aLists); } nsIFrame *child = mFrames.FirstChild(); float scale = PresContext()->GetPageScale(); - nsRect clipRect(nsPoint(0, 0), child->GetSize()); + nsRect clipRect(nsPoint(0, 0), child->GetPhysicalSize()); // Note: this computation matches how we compute maxSize.height // in nsPageFrame::Reflow - nscoord expectedPageContentHeight = NSToCoordCeil(GetSize().height / scale); + nscoord expectedPageContentHeight = NSToCoordCeil(GetPhysicalSize().height / scale); if (clipRect.height > expectedPageContentHeight) { // We're doing print-selection, with one long page-content frame. // Clip to the appropriate page-content slice for the current page. NS_ASSERTION(mPageNum > 0, "page num should be positive"); // Note: The pageContentFrame's y-position has been set such that a zero // y-value matches the top edge of the current page. So, to clip to the // current page's content (in coordinates *relative* to the page content // frame), we just negate its y-position and add the top margin. - clipRect.y = NSToCoordCeil((-child->GetRect().y + + clipRect.y = NSToCoordCeil((-child->GetPhysicalRect().y + mPD->mReflowMargin.top) / scale); clipRect.height = expectedPageContentHeight; - NS_ASSERTION(clipRect.y < child->GetSize().height, + NS_ASSERTION(clipRect.y < child->GetPhysicalSize().height, "Should be clipping to region inside the page content bounds"); } clipRect += aBuilder->ToReferenceFrame(child); nsDisplayList content; { DisplayListClipState::AutoSaveRestore clipState(aBuilder); @@ -522,17 +522,17 @@ nsPageFrame::BuildDisplayList(nsDisplayL while ((page = GetNextPage(page)) != nullptr) { BuildDisplayListForExtraPage(aBuilder, this, page, &content); } // Add the canvas background color to the bottom of the list. This // happens after we've built the list so that AddCanvasBackgroundColorItem // can monkey with the contents if necessary. nsRect backgroundRect = - nsRect(aBuilder->ToReferenceFrame(child), child->GetSize()); + nsRect(aBuilder->ToReferenceFrame(child), child->GetPhysicalSize()); PresContext()->GetPresShell()->AddCanvasBackgroundColorItem( *aBuilder, content, child, backgroundRect, NS_RGBA(0,0,0,0)); } content.AppendNewToTop(new (aBuilder) nsDisplayTransform(aBuilder, child, &content, ::ComputePageTransform)); set.Content()->AppendToTop(&content); diff --git a/layout/generic/nsSelection.cpp b/layout/generic/nsSelection.cpp --- a/layout/generic/nsSelection.cpp +++ b/layout/generic/nsSelection.cpp @@ -5047,19 +5047,19 @@ Selection::GetSelectionEndPointGeometry( return nullptr; } // Return the rect relative to the frame, with zero width. if (isText) { aRect->x = pt.x; } else if (mFrameSelection->GetHint() == nsFrameSelection::HINTLEFT) { // It's the frame's right edge we're interested in. - aRect->x = frame->GetRect().width; - } - aRect->height = frame->GetRect().height; + aRect->x = frame->GetPhysicalRect().width; + } + aRect->height = frame->GetPhysicalRect().height; return frame; } NS_IMETHODIMP Selection::ScrollSelectionIntoViewEvent::Run() { if (!mSelection) diff --git a/layout/generic/nsSimplePageSequence.cpp b/layout/generic/nsSimplePageSequence.cpp --- a/layout/generic/nsSimplePageSequence.cpp +++ b/layout/generic/nsSimplePageSequence.cpp @@ -416,17 +416,17 @@ nsSimplePageSequenceFrame::StartPrint(ns nscoord height = aPresContext->GetPageSize().height; int32_t pageNum = 1; nscoord y = 0;//mMargin.top; for (nsIFrame* page = mFrames.FirstChild(); page; page = page->GetNextSibling()) { if (pageNum >= mFromPageNum && pageNum <= mToPageNum) { - nsRect rect = page->GetRect(); + nsRect rect = page->GetPhysicalRect(); rect.y = y; rect.height = height; page->SetRect(rect); y += rect.height + mMargin.top + mMargin.bottom; } pageNum++; } @@ -691,17 +691,17 @@ nsSimplePageSequenceFrame::PrintNextPage nscoord width, height; width = PresContext()->GetPageSize().width; height = PresContext()->GetPageSize().height; height -= mMargin.top + mMargin.bottom; width -= mMargin.left + mMargin.right; nscoord selectionY = height; nsIFrame* conFrame = currentPage->GetFirstPrincipalChild(); if (mSelectionHeight >= 0) { - conFrame->SetPosition(conFrame->GetPosition() + nsPoint(0, -mYSelOffset)); + conFrame->SetPosition(conFrame->GetPhysicalPosition() + nsPoint(0, -mYSelOffset)); nsContainerFrame::PositionChildViews(conFrame); } // cast the frame to be a page frame nsPageFrame * pf = static_cast(currentPage); pf->SetPageNumInfo(mPageNum, mTotalPages); pf->SetSharedPageData(mPageData); @@ -719,27 +719,27 @@ nsSimplePageSequenceFrame::PrintNextPage } PR_PL(("SeqFr::PrintNextPage -> %p PageNo: %d", pf, mPageNum)); nsRefPtr renderingContext; dc->CreateRenderingContext(*getter_AddRefs(renderingContext)); NS_ENSURE_TRUE(renderingContext, NS_ERROR_OUT_OF_MEMORY); - nsRect drawingRect(nsPoint(0, 0), currentPage->GetSize()); + nsRect drawingRect(nsPoint(0, 0), currentPage->GetPhysicalSize()); nsRegion drawingRegion(drawingRect); nsLayoutUtils::PaintFrame(renderingContext, currentPage, drawingRegion, NS_RGBA(0,0,0,0), nsLayoutUtils::PAINT_SYNC_DECODE_IMAGES); if (mSelectionHeight >= 0 && selectionY < mSelectionHeight) { selectionY += height; printedPageNum++; pf->SetPageNumInfo(printedPageNum, mTotalPages); - conFrame->SetPosition(conFrame->GetPosition() + nsPoint(0, -height)); + conFrame->SetPosition(conFrame->GetPhysicalPosition() + nsPoint(0, -height)); nsContainerFrame::PositionChildViews(conFrame); PR_PL(("***************** End Page (PrintNextPage) *****************\n")); rv = dc->EndPage(); NS_ENSURE_SUCCESS(rv, rv); } else { continuePrinting = false; } diff --git a/layout/generic/nsSplittableFrame.cpp b/layout/generic/nsSplittableFrame.cpp --- a/layout/generic/nsSplittableFrame.cpp +++ b/layout/generic/nsSplittableFrame.cpp @@ -203,17 +203,17 @@ nsSplittableFrame::RemoveFromFlow(nsIFra nscoord nsSplittableFrame::GetConsumedHeight() const { nscoord height = 0; // Reduce the height by the computed height of prev-in-flows. for (nsIFrame* prev = GetPrevInFlow(); prev; prev = prev->GetPrevInFlow()) { - height += prev->GetRect().height; + height += prev->GetPhysicalRect().height; } return height; } nscoord nsSplittableFrame::GetEffectiveComputedHeight(const nsHTMLReflowState& aReflowState, nscoord aConsumedHeight) const diff --git a/layout/generic/nsSubDocumentFrame.cpp b/layout/generic/nsSubDocumentFrame.cpp --- a/layout/generic/nsSubDocumentFrame.cpp +++ b/layout/generic/nsSubDocumentFrame.cpp @@ -223,17 +223,17 @@ nsSubDocumentFrame::GetSubdocumentSize() // code used to do. return nsIntSize(10, 10); } else { nsSize docSizeAppUnits; nsPresContext* presContext = PresContext(); nsCOMPtr frameElem = do_QueryInterface(GetContent()); if (frameElem) { - docSizeAppUnits = GetSize(); + docSizeAppUnits = GetPhysicalSize(); } else { docSizeAppUnits = GetContentRect().Size(); } return nsIntSize(presContext->AppUnitsToDevPixels(docSizeAppUnits.width), presContext->AppUnitsToDevPixels(docSizeAppUnits.height)); } } diff --git a/layout/generic/nsTextFrame.cpp b/layout/generic/nsTextFrame.cpp --- a/layout/generic/nsTextFrame.cpp +++ b/layout/generic/nsTextFrame.cpp @@ -3324,17 +3324,17 @@ PropertyProvider::SetupJustificationSpac GetSkippedDistance(mStart, realEnd), this); if (mFrame->GetStateBits() & TEXT_HYPHEN_BREAK) { nsAutoPtr hyphenTextRun(GetHyphenTextRun(mTextRun, nullptr, mFrame)); if (hyphenTextRun.get()) { naturalWidth += hyphenTextRun->GetAdvanceWidth(0, hyphenTextRun->GetLength(), nullptr); } } - gfxFloat totalJustificationSpace = mFrame->GetSize().width - naturalWidth; + gfxFloat totalJustificationSpace = mFrame->GetPhysicalSize().width - naturalWidth; if (totalJustificationSpace <= 0) { // No space available return; } mJustificationSpacing = totalJustificationSpace/justifiableCharacters; } @@ -4452,17 +4452,17 @@ public: *aSnap = false; nsRect temp = mFrame->GetVisualOverflowRectRelativeToSelf() + ToReferenceFrame(); // Bug 748228 temp.Inflate(mFrame->PresContext()->AppUnitsPerDevPixel()); return temp; } virtual void HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect, HitTestState* aState, nsTArray *aOutFrames) { - if (nsRect(ToReferenceFrame(), mFrame->GetSize()).Intersects(aRect)) { + if (nsRect(ToReferenceFrame(), mFrame->GetPhysicalSize()).Intersects(aRect)) { aOutFrames->AppendElement(mFrame); } } virtual void Paint(nsDisplayListBuilder* aBuilder, nsRenderingContext* aCtx); NS_DISPLAY_DECL_NAME("Text", TYPE_TEXT) virtual nsRect GetComponentAlphaBounds(nsDisplayListBuilder* aBuilder) @@ -4664,27 +4664,27 @@ nsTextFrame::GetTextDecorations( // that should be set (see nsLineLayout::VerticalAlignLine). if (firstBlock) { // At this point, fChild can't be null since TextFrames can't be blocks if (fChild->VerticalAlignEnum() != NS_STYLE_VERTICAL_ALIGN_BASELINE) { // Since offset is the offset in the child's coordinate space, we have // to undo the accumulation to bring the transform out of the block's // coordinate space baselineOffset = - frameTopOffset - fChild->GetNormalPosition().y + frameTopOffset - fChild->GetNormalPhysicalPosition().y - NS_PTR_TO_INT32( fChild->Properties().Get(nsIFrame::LineBaselineOffset())); } } else if (!nearestBlockFound) { baselineOffset = frameTopOffset - f->GetBaseline(); } nearestBlockFound = nearestBlockFound || firstBlock; - frameTopOffset += f->GetNormalPosition().y; + frameTopOffset += f->GetNormalPhysicalPosition().y; const uint8_t style = styleText->GetDecorationStyle(); if (textDecorations) { nscolor color; if (useOverride) { color = overrideColor; } else if (IsSVGText()) { // XXX We might want to do something with text-decoration-color when @@ -4810,17 +4810,17 @@ nsTextFrame::UnionAdditionalOverflow(nsP // maxima and minima are required to reliably generate the rectangle for // them TextDecorations textDecs; GetTextDecorations(aPresContext, eResolvedColors, textDecs); if (textDecs.HasDecorationLines()) { nscoord inflationMinFontSize = nsLayoutUtils::InflationMinFontSizeFor(aBlockReflowState.frame); - const nscoord width = GetSize().width; + const nscoord width = GetPhysicalSize().width; const gfxFloat appUnitsPerDevUnit = aPresContext->AppUnitsPerDevPixel(), gfxWidth = width / appUnitsPerDevUnit, ascent = gfxFloat(mAscent) / appUnitsPerDevUnit; nscoord top(nscoord_MAX), bottom(nscoord_MIN); // Below we loop through all text decorations and compute the rectangle // containing all of them, in this frame's coordinate space for (uint32_t i = 0; i < textDecs.mUnderlines.Length(); ++i) { const LineDecoration& dec = textDecs.mUnderlines[i]; @@ -5441,17 +5441,17 @@ nsTextFrame::PaintTextWithSelectionColor // Draw background color gfxFloat advance = hyphenWidth + mTextRun->GetAdvanceWidth(offset, length, &aProvider); if (NS_GET_A(background) > 0) { gfxFloat x = xOffset - (mTextRun->IsRightToLeft() ? advance : 0); PaintSelectionBackground(aCtx, aTextPaintStyle.PresContext(), background, aDirtyRect, gfxRect(aFramePt.x + x, aFramePt.y, advance, - GetSize().height), aCallbacks); + GetPhysicalSize().height), aCallbacks); } iterator.UpdateWithAdvance(advance); } } // Draw text const nsStyleText* textStyle = StyleText(); nsRect dirtyRect(aDirtyRect.x, aDirtyRect.y, @@ -5746,17 +5746,17 @@ nsTextFrame::MeasureCharClippedText(Prop *aSnappedLeftEdge = 0; *aSnappedRightEdge = 0; if (aLeftEdge <= 0 && aRightEdge <= 0) { return true; } uint32_t offset = *aStartOffset; uint32_t maxLength = *aMaxLength; - const nscoord frameWidth = GetSize().width; + const nscoord frameWidth = GetPhysicalSize().width; const bool rtl = mTextRun->IsRightToLeft(); gfxFloat advanceWidth = 0; const nscoord startEdge = rtl ? aRightEdge : aLeftEdge; if (startEdge > 0) { const gfxFloat maxAdvance = gfxFloat(startEdge); while (maxLength > 0) { uint32_t clusterLength = GetClusterLength(mTextRun, offset, maxLength, rtl); @@ -5812,17 +5812,17 @@ nsTextFrame::PaintText(nsRenderingContex return; PropertyProvider provider(this, iter, nsTextFrame::eInflated); // Trim trailing whitespace provider.InitializeForDisplay(true); gfxContext* ctx = aRenderingContext->ThebesContext(); const bool rtl = mTextRun->IsRightToLeft(); - const nscoord frameWidth = GetSize().width; + const nscoord frameWidth = GetPhysicalSize().width; gfxPoint framePt(aPt.x, aPt.y); gfxPoint textBaselinePt(rtl ? gfxFloat(aPt.x + frameWidth) : framePt.x, nsLayoutUtils::GetSnappedBaselineY(this, ctx, aPt.y, mAscent)); uint32_t startOffset = provider.GetStart().GetSkippedOffset(); uint32_t maxLength = ComputeTransformedLength(provider); nscoord snappedLeftEdge, snappedRightEdge; if (!MeasureCharClippedText(provider, aItem.mLeftEdge, aItem.mRightEdge, &startOffset, &maxLength, &snappedLeftEdge, &snappedRightEdge)) { @@ -5947,17 +5947,17 @@ nsTextFrame::DrawTextRunAndDecorations( const nscolor* const aDecorationOverrideColor, gfxTextContextPaint* aContextPaint, nsTextFrame::DrawPathCallbacks* aCallbacks) { const gfxFloat app = aTextStyle.PresContext()->AppUnitsPerDevPixel(); // XXX aFramePt is in AppUnits, shouldn't it be nsFloatPoint? nscoord x = NSToCoordRound(aFramePt.x); - nscoord width = GetRect().width; + nscoord width = GetPhysicalRect().width; aClipEdges.Intersect(&x, &width); gfxPoint decPt(x / app, 0); gfxSize decSize(width / app, 0); const gfxFloat ascent = gfxFloat(mAscent) / app; const gfxFloat frameTop = aFramePt.y; gfxRect dirtyRect(aDirtyRect.x / app, aDirtyRect.y / app, @@ -6307,17 +6307,17 @@ nsTextFrame::SetSelectedRange(uint32_t a nsPresContext* presContext = PresContext(); while (f && f->GetContentOffset() < int32_t(aEnd)) { // We may need to reflow to recompute the overflow area for // spellchecking or IME underline if their underline is thicker than // the normal decoration line. if (aType & SelectionTypesWithDecorations) { bool didHaveOverflowingSelection = (f->GetStateBits() & TEXT_SELECTION_UNDERLINE_OVERFLOWED) != 0; - nsRect r(nsPoint(0, 0), GetSize()); + nsRect r(nsPoint(0, 0), GetPhysicalSize()); bool willHaveOverflowingSelection = aSelected && f->CombineSelectionUnderlineRect(presContext, r); if (didHaveOverflowingSelection || willHaveOverflowingSelection) { presContext->PresShell()->FrameNeedsReflow(f, nsIPresShell::eStyleChange, NS_FRAME_IS_DIRTY); } } @@ -7780,17 +7780,17 @@ nsTextFrame::ReflowText(nsLineLayout& aL ///////////////////////////////////////////////////////////////////// // See how much text should belong to this text frame, and measure it ///////////////////////////////////////////////////////////////////// iter.SetOriginalOffset(offset); nscoord xOffsetForTabs = (mTextRun->GetFlags() & nsTextFrameUtils::TEXT_HAS_TAB) ? (aLineLayout.GetCurrentFrameXDistanceFromBlock() - - lineContainer->GetUsedBorderAndPadding().left) + lineContainer->GetUsedPhysicalBorderAndPadding().left) : -1; PropertyProvider provider(mTextRun, textStyle, frag, this, iter, length, lineContainer, xOffsetForTabs, nsTextFrame::eInflated); uint32_t transformedOffset = provider.GetStart().GetSkippedOffset(); // The metrics for the text go in here gfxTextRun::Metrics textMetrics; @@ -8199,17 +8199,17 @@ nsTextFrame::TrimTrailingWhiteSpace(nsRe printf(": trim => %d\n", result.mDeltaWidth); #endif return result; } nsOverflowAreas nsTextFrame::RecomputeOverflow(const nsHTMLReflowState& aBlockReflowState) { - nsRect bounds(nsPoint(0, 0), GetSize()); + nsRect bounds(nsPoint(0, 0), GetPhysicalSize()); nsOverflowAreas result(bounds, bounds); gfxSkipCharsIterator iter = EnsureTextRun(nsTextFrame::eInflated); if (!mTextRun) return result; PropertyProvider provider(this, iter, nsTextFrame::eInflated); provider.InitializeForDisplay(true); diff --git a/layout/generic/nsVideoFrame.cpp b/layout/generic/nsVideoFrame.cpp --- a/layout/generic/nsVideoFrame.cpp +++ b/layout/generic/nsVideoFrame.cpp @@ -168,17 +168,17 @@ CorrectForAspectRatio(const gfxRect& aRe } already_AddRefed nsVideoFrame::BuildLayer(nsDisplayListBuilder* aBuilder, LayerManager* aManager, nsDisplayItem* aItem, const ContainerParameters& aContainerParameters) { - nsRect area = GetContentRect() - GetPosition() + aItem->ToReferenceFrame(); + nsRect area = GetContentRect() - GetPhysicalPosition() + aItem->ToReferenceFrame(); HTMLVideoElement* element = static_cast(GetContent()); nsIntSize videoSize; if (NS_FAILED(element->GetVideoSize(&videoSize)) || area.IsEmpty()) { return nullptr; } nsRefPtr container = element->GetImageContainer(); if (!container) @@ -312,24 +312,24 @@ nsVideoFrame::Reflow(nsPresContext* ReflowChild(imageFrame, aPresContext, kidDesiredSize, kidReflowState, posterTopLeft.x, posterTopLeft.y, 0, aStatus); FinishReflowChild(imageFrame, aPresContext, &kidReflowState, kidDesiredSize, posterTopLeft.x, posterTopLeft.y, 0); } else if (child->GetContent() == mVideoControls) { // Reflow the video controls frame. nsBoxLayoutState boxState(PresContext(), aReflowState.rendContext); - nsSize size = child->GetSize(); + nsSize size = child->GetPhysicalSize(); nsBoxFrame::LayoutChildAt(boxState, child, nsRect(mBorderPadding.left, mBorderPadding.top, aReflowState.ComputedWidth(), aReflowState.ComputedHeight())); - if (child->GetSize() != size) { + if (child->GetPhysicalSize() != size) { nsRefPtr event = new DispatchResizeToControls(child->GetContent()); nsContentUtils::AddScriptRunner(event); } } else if (child->GetContent() == mCaptionDiv) { // Reflow to caption div nsHTMLReflowMetrics kidDesiredSize; nsSize availableSize = nsSize(aReflowState.availableWidth, aReflowState.availableHeight); @@ -387,17 +387,17 @@ public: // when we come to paint, the video frame is transparent or has gone // away completely (e.g. because of a decoder error). The problem would // be especially acute if we have off-main-thread rendering. virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap) { *aSnap = true; nsIFrame* f = Frame(); - return f->GetContentRect() - f->GetPosition() + ToReferenceFrame(); + return f->GetContentRect() - f->GetPhysicalPosition() + ToReferenceFrame(); } virtual already_AddRefed BuildLayer(nsDisplayListBuilder* aBuilder, LayerManager* aManager, const ContainerParameters& aContainerParameters) { return static_cast(mFrame)->BuildLayer(aBuilder, aManager, this, aContainerParameters); } diff --git a/layout/generic/nsViewportFrame.cpp b/layout/generic/nsViewportFrame.cpp --- a/layout/generic/nsViewportFrame.cpp +++ b/layout/generic/nsViewportFrame.cpp @@ -219,17 +219,17 @@ ViewportFrame::Reflow(nsPresContext* // Reflow the frame kidReflowState.SetComputedHeight(aReflowState.ComputedHeight()); rv = ReflowChild(kidFrame, aPresContext, kidDesiredSize, kidReflowState, 0, 0, 0, aStatus); kidHeight = kidDesiredSize.height; FinishReflowChild(kidFrame, aPresContext, nullptr, kidDesiredSize, 0, 0, 0); } else { - kidHeight = mFrames.FirstChild()->GetSize().height; + kidHeight = mFrames.FirstChild()->GetPhysicalSize().height; } } NS_ASSERTION(aReflowState.availableWidth != NS_UNCONSTRAINEDSIZE, "shouldn't happen anymore"); // Return the max size as our desired size aDesiredSize.width = aReflowState.availableWidth; diff --git a/layout/inspector/src/inFlasher.cpp b/layout/inspector/src/inFlasher.cpp --- a/layout/inspector/src/inFlasher.cpp +++ b/layout/inspector/src/inFlasher.cpp @@ -126,17 +126,17 @@ inFlasher::DrawElementOutline(nsIDOMElem while (frame) { nsPoint offset; nsIWidget* widget = frame->GetNearestWidget(offset); if (widget) { nsRefPtr rcontext = new nsRenderingContext(); rcontext->Init(frame->PresContext()->DeviceContext(), widget->GetThebesSurface()); - nsRect rect(offset, frame->GetSize()); + nsRect rect(offset, frame->GetPhysicalSize()); if (mInvert) { rcontext->InvertRect(rect); } bool isLastFrame = frame->GetNextContinuation() == nullptr; DrawOutline(rect.x, rect.y, rect.width, rect.height, rcontext, isFirstFrame, isLastFrame); isFirstFrame = false; diff --git a/layout/ipc/RenderFrameParent.cpp b/layout/ipc/RenderFrameParent.cpp --- a/layout/ipc/RenderFrameParent.cpp +++ b/layout/ipc/RenderFrameParent.cpp @@ -134,17 +134,17 @@ GetContentRectLayerOffset(nsIFrame* aCon { nscoord auPerDevPixel = aContainerFrame->PresContext()->AppUnitsPerDevPixel(); // Offset to the content rect in case we have borders or padding // Note that aContainerFrame could be a reference frame itself, so // we need to be careful here to ensure that we call ToReferenceFrame // on aContainerFrame and not its parent. nsPoint frameOffset = aBuilder->ToReferenceFrame(aContainerFrame) + - (aContainerFrame->GetContentRect().TopLeft() - aContainerFrame->GetPosition()); + (aContainerFrame->GetContentRect().TopLeft() - aContainerFrame->GetPhysicalPosition()); return frameOffset.ToNearestPixels(auPerDevPixel); } // Compute the transform of the shadow tree contained by // |aContainerFrame| to widget space. We transform because the // subprocess layer manager renders to a different top-left than where // the shadow tree is drawn here and because a scale can be set on the @@ -450,17 +450,17 @@ BuildBackgroundPatternFor(ContainerLayer gfxRect localContentVis(t.Transform(contentVis)); // Round *in* here because this area is punched out of the background localContentVis.RoundIn(); nsIntRect localIntContentVis(localContentVis.X(), localContentVis.Y(), localContentVis.Width(), localContentVis.Height()); // Get the frame's rect nscoord auPerDevPixel = aFrame->PresContext()->AppUnitsPerDevPixel(); - nsIntRect frameRect = aFrame->GetRect().ToOutsidePixels(auPerDevPixel); + nsIntRect frameRect = aFrame->GetPhysicalRect().ToOutsidePixels(auPerDevPixel); // If the shadow tree covers the frame rect, don't bother building // the background, it wouldn't be visible if (localIntContentVis.Contains(frameRect)) { return; } nsRefPtr layer = aManager->CreateColorLayer(); layer->SetColor(aColor); diff --git a/layout/mathml/nsMathMLChar.cpp b/layout/mathml/nsMathMLChar.cpp --- a/layout/mathml/nsMathMLChar.cpp +++ b/layout/mathml/nsMathMLChar.cpp @@ -1688,17 +1688,17 @@ public: virtual ~nsDisplayMathMLCharForeground() { MOZ_COUNT_DTOR(nsDisplayMathMLCharForeground); } #endif virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap) { *aSnap = false; nsRect rect; - mChar->GetRect(rect); + mChar->GetPhysicalRect(rect); nsPoint offset = ToReferenceFrame() + rect.TopLeft(); nsBoundingMetrics bm; mChar->GetBoundingMetrics(bm); nsRect temp(offset.x + bm.leftBearing, offset.y, bm.rightBearing - bm.leftBearing, bm.ascent + bm.descent); // Bug 748220 temp.Inflate(mFrame->PresContext()->AppUnitsPerDevPixel()); return temp; diff --git a/layout/mathml/nsMathMLChar.h b/layout/mathml/nsMathMLChar.h --- a/layout/mathml/nsMathMLChar.h +++ b/layout/mathml/nsMathMLChar.h @@ -129,17 +129,17 @@ public: // Sometimes we only want to pass the data to another routine, // this function helps to avoid copying const PRUnichar* get() { return mData.get(); } void - GetRect(nsRect& aRect) { + GetPhysicalRect(nsRect& aRect) { aRect = mRect; } void SetRect(const nsRect& aRect) { mRect = aRect; } diff --git a/layout/mathml/nsMathMLContainerFrame.cpp b/layout/mathml/nsMathMLContainerFrame.cpp --- a/layout/mathml/nsMathMLContainerFrame.cpp +++ b/layout/mathml/nsMathMLContainerFrame.cpp @@ -88,17 +88,17 @@ void nsDisplayMathMLError::Paint(nsDispl { // Set color and font ... nsRefPtr fm; nsLayoutUtils::GetFontMetricsForFrame(mFrame, getter_AddRefs(fm)); aCtx->SetFont(fm); nsPoint pt = ToReferenceFrame(); aCtx->SetColor(NS_RGB(255,0,0)); - aCtx->FillRect(nsRect(pt, mFrame->GetSize())); + aCtx->FillRect(nsRect(pt, mFrame->GetPhysicalSize())); aCtx->SetColor(NS_RGB(255,255,255)); nscoord ascent = aCtx->FontMetrics()->MaxAscent(); NS_NAMED_LITERAL_STRING(errorMsg, "invalid-markup"); aCtx->DrawString(errorMsg.get(), uint32_t(errorMsg.Length()), pt.x, pt.y+ascent); } @@ -410,17 +410,17 @@ nsMathMLContainerFrame::Stretch(nsRender if (dx != 0) { mBoundingMetrics.leftBearing += dx; mBoundingMetrics.rightBearing += dx; aDesiredStretchSize.mBoundingMetrics.leftBearing += dx; aDesiredStretchSize.mBoundingMetrics.rightBearing += dx; nsIFrame* childFrame = mFrames.FirstChild(); while (childFrame) { - childFrame->SetPosition(childFrame->GetPosition() + childFrame->SetPosition(childFrame->GetPhysicalPosition() + nsPoint(dx, 0)); childFrame = childFrame->GetNextSibling(); } } } // Finished with these: ClearSavedChildMetrics(); @@ -1390,17 +1390,17 @@ nsMathMLContainerFrame::FixInterFrameSpa // add our own italic correction nscoord leftCorrection = 0, italicCorrection = 0; GetItalicCorrection(mBoundingMetrics, leftCorrection, italicCorrection); gap += leftCorrection; // see if we should shift our children to account for the correction if (gap) { nsIFrame* childFrame = mFrames.FirstChild(); while (childFrame) { - childFrame->SetPosition(childFrame->GetPosition() + nsPoint(gap, 0)); + childFrame->SetPosition(childFrame->GetPhysicalPosition() + nsPoint(gap, 0)); childFrame = childFrame->GetNextSibling(); } mBoundingMetrics.leftBearing += gap; mBoundingMetrics.rightBearing += gap; mBoundingMetrics.width += gap; aDesiredSize.width += gap; } mBoundingMetrics.width += italicCorrection; diff --git a/layout/mathml/nsMathMLmencloseFrame.cpp b/layout/mathml/nsMathMLmencloseFrame.cpp --- a/layout/mathml/nsMathMLmencloseFrame.cpp +++ b/layout/mathml/nsMathMLmencloseFrame.cpp @@ -196,34 +196,34 @@ nsMathMLmencloseFrame::BuildDisplayList( { ///////////// // paint the menclosed content nsMathMLContainerFrame::BuildDisplayList(aBuilder, aDirtyRect, aLists); if (NS_MATHML_HAS_ERROR(mPresentationData.flags)) return; - nsRect mencloseRect = nsIFrame::GetRect(); + nsRect mencloseRect = nsIFrame::GetPhysicalRect(); mencloseRect.x = mencloseRect.y = 0; if (IsToDraw(NOTATION_RADICAL)) { mMathMLChar[mRadicalCharIndex].Display(aBuilder, this, aLists, 0); nsRect rect; - mMathMLChar[mRadicalCharIndex].GetRect(rect); + mMathMLChar[mRadicalCharIndex].GetPhysicalRect(rect); rect.MoveBy(StyleVisibility()->mDirection ? -mContentWidth : rect.width, 0); rect.SizeTo(mContentWidth, mRuleThickness); DisplayBar(aBuilder, this, rect, aLists); } if (IsToDraw(NOTATION_LONGDIV)) { mMathMLChar[mLongDivCharIndex].Display(aBuilder, this, aLists, 1); nsRect rect; - mMathMLChar[mLongDivCharIndex].GetRect(rect); + mMathMLChar[mLongDivCharIndex].GetPhysicalRect(rect); rect.SizeTo(rect.width + mContentWidth, mRuleThickness); DisplayBar(aBuilder, this, rect, aLists); } if (IsToDraw(NOTATION_TOP)) { nsRect rect(0, 0, mencloseRect.width, mRuleThickness); DisplayBar(aBuilder, this, rect, aLists); } @@ -660,17 +660,17 @@ nsMathMLmencloseFrame::FixInterFrameSpac { nscoord gap = nsMathMLContainerFrame::FixInterFrameSpacing(aDesiredSize); if (!gap) return 0; // Move the MathML characters nsRect rect; for (uint32_t i = 0; i < mMathMLChar.Length(); i++) { - mMathMLChar[i].GetRect(rect); + mMathMLChar[i].GetPhysicalRect(rect); rect.MoveBy(gap, 0); mMathMLChar[i].SetRect(rect); } return gap; } NS_IMETHODIMP diff --git a/layout/mathml/nsMathMLmfencedFrame.cpp b/layout/mathml/nsMathMLmfencedFrame.cpp --- a/layout/mathml/nsMathMLmfencedFrame.cpp +++ b/layout/mathml/nsMathMLmfencedFrame.cpp @@ -518,17 +518,17 @@ nsMathMLmfencedFrame::PlaceChar(nsMathML nscoord& dx) { aMathMLChar->GetBoundingMetrics(bm); // the char's x-origin was used to store lspace ... // the char's y-origin was used to store the ascent ... // the char's width was used to store the advance with (with spacing) ... nsRect rect; - aMathMLChar->GetRect(rect); + aMathMLChar->GetPhysicalRect(rect); nscoord dy = aDesiredAscent - rect.y; if (aMathMLChar->GetStretchDirection() != NS_STRETCH_DIRECTION_UNSUPPORTED) { // the stretchy char will be centered around the axis // so we adjust the returned bounding metrics accordingly bm.descent = (bm.ascent + bm.descent) - rect.y; bm.ascent = rect.y; } @@ -613,27 +613,27 @@ nsMathMLmfencedFrame::GetIntrinsicWidth( nscoord nsMathMLmfencedFrame::FixInterFrameSpacing(nsHTMLReflowMetrics& aDesiredSize) { nscoord gap = nsMathMLContainerFrame::FixInterFrameSpacing(aDesiredSize); if (!gap) return 0; nsRect rect; if (mOpenChar) { - mOpenChar->GetRect(rect); + mOpenChar->GetPhysicalRect(rect); rect.MoveBy(gap, 0); mOpenChar->SetRect(rect); } if (mCloseChar) { - mCloseChar->GetRect(rect); + mCloseChar->GetPhysicalRect(rect); rect.MoveBy(gap, 0); mCloseChar->SetRect(rect); } for (int32_t i = 0; i < mSeparatorsCount; i++) { - mSeparatorsChar[i].GetRect(rect); + mSeparatorsChar[i].GetPhysicalRect(rect); rect.MoveBy(gap, 0); mSeparatorsChar[i].SetRect(rect); } return gap; } // ---------------------- // the Style System will use these to pass the proper style context to our MathMLChar diff --git a/layout/mathml/nsMathMLmoFrame.cpp b/layout/mathml/nsMathMLmoFrame.cpp --- a/layout/mathml/nsMathMLmoFrame.cpp +++ b/layout/mathml/nsMathMLmoFrame.cpp @@ -90,17 +90,17 @@ nsMathMLmoFrame::BuildDisplayList(nsDisp } else { DisplayBorderBackgroundOutline(aBuilder, aLists); // make our char selected if our inner child text frame is selected bool isSelected = false; nsRect selectedRect; nsIFrame* firstChild = mFrames.FirstChild(); if (IsFrameInSelection(firstChild)) { - mMathMLChar.GetRect(selectedRect); + mMathMLChar.GetPhysicalRect(selectedRect); // add a one pixel border (it renders better for operators like minus) selectedRect.Inflate(nsPresContext::CSSPixelsToAppUnits(1)); isSelected = true; } mMathMLChar.Display(aBuilder, this, aLists, 0, isSelected ? &selectedRect : nullptr); #if defined(DEBUG) && defined(SHOW_BOUNDING_BOX) // for visual debug @@ -828,17 +828,17 @@ nsMathMLmoFrame::Stretch(nsRenderingCont parentData.coreFrame != this; } if (isAccent && firstChild) { // see bug 188467 for what is going on here nscoord dy = aDesiredStretchSize.ascent - (mBoundingMetrics.ascent + leading); aDesiredStretchSize.ascent = mBoundingMetrics.ascent + leading; aDesiredStretchSize.height = aDesiredStretchSize.ascent + mBoundingMetrics.descent; - firstChild->SetPosition(firstChild->GetPosition() - nsPoint(0, dy)); + firstChild->SetPosition(firstChild->GetPhysicalPosition() - nsPoint(0, dy)); } else if (useMathMLChar) { nscoord ascent = fm->MaxAscent(); nscoord descent = fm->MaxDescent(); aDesiredStretchSize.ascent = std::max(mBoundingMetrics.ascent + leading, ascent); aDesiredStretchSize.height = aDesiredStretchSize.ascent + std::max(mBoundingMetrics.descent + leading, descent); } @@ -879,24 +879,24 @@ nsMathMLmoFrame::Stretch(nsRenderingCont // adjust the offsets mBoundingMetrics.leftBearing += dx; mBoundingMetrics.rightBearing += dx; aDesiredStretchSize.mBoundingMetrics.leftBearing += dx; aDesiredStretchSize.mBoundingMetrics.rightBearing += dx; if (useMathMLChar) { nsRect rect; - mMathMLChar.GetRect(rect); + mMathMLChar.GetPhysicalRect(rect); mMathMLChar.SetRect(nsRect(rect.x + dx, rect.y, rect.width, rect.height)); } else { nsIFrame* childFrame = firstChild; while (childFrame) { - childFrame->SetPosition(childFrame->GetPosition() + + childFrame->SetPosition(childFrame->GetPhysicalPosition() + nsPoint(dx, 0)); childFrame = childFrame->GetNextSibling(); } } } } // Finished with these: diff --git a/layout/mathml/nsMathMLmrootFrame.cpp b/layout/mathml/nsMathMLmrootFrame.cpp --- a/layout/mathml/nsMathMLmrootFrame.cpp +++ b/layout/mathml/nsMathMLmrootFrame.cpp @@ -92,17 +92,17 @@ nsMathMLmrootFrame::BuildDisplayList(nsD if (!NS_MATHML_HAS_ERROR(mPresentationData.flags)) { mSqrChar.Display(aBuilder, this, aLists, 0); DisplayBar(aBuilder, this, mBarRect, aLists); #if defined(DEBUG) && defined(SHOW_BOUNDING_BOX) // for visual debug nsRect rect; - mSqrChar.GetRect(rect); + mSqrChar.GetPhysicalRect(rect); nsBoundingMetrics bm; mSqrChar.GetBoundingMetrics(bm); DisplayBoundingMetrics(aBuilder, this, rect.TopLeft(), bm, aLists); #endif } } static void diff --git a/layout/mathml/nsMathMLmtableFrame.cpp b/layout/mathml/nsMathMLmtableFrame.cpp --- a/layout/mathml/nsMathMLmtableFrame.cpp +++ b/layout/mathml/nsMathMLmtableFrame.cpp @@ -572,19 +572,19 @@ nsMathMLmtableOuterFrame::Reflow(nsPresC nscoord dy = 0; nscoord height = aDesiredSize.height; nsIFrame* rowFrame = nullptr; if (rowIndex) { rowFrame = GetRowFrameAt(aPresContext, rowIndex); if (rowFrame) { // translate the coordinates to be relative to us nsIFrame* frame = rowFrame; - height = frame->GetSize().height; + height = frame->GetPhysicalSize().height; do { - dy += frame->GetPosition().y; + dy += frame->GetPhysicalPosition().y; frame = frame->GetParent(); } while (frame != this); } } switch (tableAlign) { case eAlign_top: aDesiredSize.ascent = dy; break; diff --git a/layout/printing/nsPrintEngine.cpp b/layout/printing/nsPrintEngine.cpp --- a/layout/printing/nsPrintEngine.cpp +++ b/layout/printing/nsPrintEngine.cpp @@ -2809,33 +2809,33 @@ nsPrintEngine::FindSelectionBoundsWithLi nsIFrame *& aStartFrame, nsRect& aStartRect, nsIFrame *& aEndFrame, nsRect& aEndRect) { NS_ASSERTION(aPresContext, "Pointer is null!"); NS_ASSERTION(aParentFrame, "Pointer is null!"); - aRect += aParentFrame->GetPosition(); + aRect += aParentFrame->GetPhysicalPosition(); for (; !aChildFrames.AtEnd(); aChildFrames.Next()) { nsIFrame* child = aChildFrames.get(); if (child->IsSelected() && child->IsVisibleForPainting()) { - nsRect r = child->GetRect(); + nsRect r = child->GetPhysicalRect(); if (aStartFrame == nullptr) { aStartFrame = child; aStartRect.SetRect(aRect.x + r.x, aRect.y + r.y, r.width, r.height); } else { aEndFrame = child; aEndRect.SetRect(aRect.x + r.x, aRect.y + r.y, r.width, r.height); } } FindSelectionBounds(aPresContext, aRC, child, aRect, aStartFrame, aStartRect, aEndFrame, aEndRect); child = child->GetNextSibling(); } - aRect -= aParentFrame->GetPosition(); + aRect -= aParentFrame->GetPhysicalPosition(); return NS_OK; } //------------------------------------------------------- // Find the Frame that is XMost nsresult nsPrintEngine::FindSelectionBounds(nsPresContext* aPresContext, nsRenderingContext& aRC, @@ -2891,17 +2891,17 @@ nsPrintEngine::GetPageRangeForSelection( } nsIFrame * startFrame = nullptr; nsIFrame * endFrame = nullptr; // start out with the sequence frame and search the entire frame tree // capturing the starting and ending child frames of the selection // and their rects - nsRect r = seqFrame->GetRect(); + nsRect r = seqFrame->GetPhysicalRect(); FindSelectionBounds(aPresContext, aRC, seqFrame, r, startFrame, aStartRect, endFrame, aEndRect); #ifdef DEBUG_rodsX printf("Start Frame: %p\n", startFrame); printf("End Frame: %p\n", endFrame); #endif @@ -3714,17 +3714,17 @@ static void DumpFrames(FILE* fprintf(out, " "); } nsAutoString tmp; child->GetFrameName(tmp); fputs(NS_LossyConvertUTF16toASCII(tmp).get(), out); bool isSelected; if (NS_SUCCEEDED(child->IsVisibleForPainting(aPresContext, *aRendContext, true, &isSelected))) { fprintf(out, " %p %s", child, isSelected?"VIS":"UVS"); - nsRect rect = child->GetRect(); + nsRect rect = child->GetPhysicalRect(); fprintf(out, "[%d,%d,%d,%d] ", rect.x, rect.y, rect.width, rect.height); fprintf(out, "v: %p ", (void*)child->GetView()); fprintf(out, "\n"); DumpFrames(out, aPresContext, aRendContext, child, aLevel+1); child = child->GetNextSibling(); } } } diff --git a/layout/style/nsComputedDOMStyle.cpp b/layout/style/nsComputedDOMStyle.cpp --- a/layout/style/nsComputedDOMStyle.cpp +++ b/layout/style/nsComputedDOMStyle.cpp @@ -381,21 +381,21 @@ nsComputedDOMStyle::GetAdjustedValuesFor { // We want the width/height of whatever parts 'width' or 'height' controls, // which can be different depending on the value of the 'box-sizing' property. const nsStylePosition* stylePos = StylePosition(); nsMargin adjustment; switch(stylePos->mBoxSizing) { case NS_STYLE_BOX_SIZING_BORDER: - adjustment += mInnerFrame->GetUsedBorder(); + adjustment += mInnerFrame->GetUsedPhysicalBorder(); // fall through case NS_STYLE_BOX_SIZING_PADDING: - adjustment += mInnerFrame->GetUsedPadding(); + adjustment += mInnerFrame->GetUsedPhysicalPadding(); } return adjustment; } /* static */ nsIPresShell* nsComputedDOMStyle::GetPresShellForContent(nsIContent* aContent) @@ -3719,21 +3719,21 @@ nsComputedDOMStyle::GetOffsetWidthFor(mo } CSSValue* nsComputedDOMStyle::GetAbsoluteOffset(mozilla::css::Side aSide) { MOZ_ASSERT(mOuterFrame, "need a frame, so we can call GetContainingBlock()"); nsIFrame* container = mOuterFrame->GetContainingBlock(); - nsMargin margin = mOuterFrame->GetUsedMargin(); - nsMargin border = container->GetUsedBorder(); + nsMargin margin = mOuterFrame->GetUsedPhysicalMargin(); + nsMargin border = container->GetUsedPhysicalBorder(); nsMargin scrollbarSizes(0, 0, 0, 0); - nsRect rect = mOuterFrame->GetRect(); - nsRect containerRect = container->GetRect(); + nsRect rect = mOuterFrame->GetPhysicalRect(); + nsRect containerRect = container->GetPhysicalRect(); if (container->GetType() == nsGkAtoms::viewportFrame) { // For absolutely positioned frames scrollbars are taken into // account by virtue of getting a containing block that does // _not_ include the scrollbars. For fixed positioned frames, // the containing block is the viewport, which _does_ include // scrollbars. We have to do some extra work. // the first child in the default frame list is what we want @@ -3853,17 +3853,17 @@ nsComputedDOMStyle::GetPaddingWidthFor(m { nsROCSSPrimitiveValue* val = new nsROCSSPrimitiveValue; if (!mInnerFrame) { SetValueToCoord(val, StylePadding()->mPadding.Get(aSide), true); } else { AssertFlushedPendingReflows(); - val->SetAppUnits(mInnerFrame->GetUsedPadding().Side(aSide)); + val->SetAppUnits(mInnerFrame->GetUsedPhysicalPadding().Side(aSide)); } return val; } bool nsComputedDOMStyle::GetLineHeightCoord(nscoord& aCoord) { @@ -3933,17 +3933,17 @@ nsComputedDOMStyle::GetBorderColorsFor(m CSSValue* nsComputedDOMStyle::GetBorderWidthFor(mozilla::css::Side aSide) { nsROCSSPrimitiveValue* val = new nsROCSSPrimitiveValue; nscoord width; if (mInnerFrame) { AssertFlushedPendingReflows(); - width = mInnerFrame->GetUsedBorder().Side(aSide); + width = mInnerFrame->GetUsedPhysicalBorder().Side(aSide); } else { width = StyleBorder()->GetComputedBorderWidth(aSide); } val->SetAppUnits(width); return val; } @@ -3968,21 +3968,21 @@ nsComputedDOMStyle::GetMarginWidthFor(mo { nsROCSSPrimitiveValue* val = new nsROCSSPrimitiveValue; if (!mInnerFrame) { SetValueToCoord(val, StyleMargin()->mMargin.Get(aSide), false); } else { AssertFlushedPendingReflows(); - // For tables, GetUsedMargin always returns an empty margin, so we + // For tables, GetUsedPhysicalMargin always returns an empty margin, so we // should read the margin from the outer table frame instead. - val->SetAppUnits(mOuterFrame->GetUsedMargin().Side(aSide)); + val->SetAppUnits(mOuterFrame->GetUsedPhysicalMargin().Side(aSide)); NS_ASSERTION(mOuterFrame == mInnerFrame || - mInnerFrame->GetUsedMargin() == nsMargin(0, 0, 0, 0), + mInnerFrame->GetUsedPhysicalMargin() == nsMargin(0, 0, 0, 0), "Inner tables must have zero margins"); } return val; } CSSValue* nsComputedDOMStyle::GetBorderStyleFor(mozilla::css::Side aSide) @@ -4205,30 +4205,30 @@ bool nsComputedDOMStyle::GetFrameBorderRectWidth(nscoord& aWidth) { if (!mInnerFrame) { return false; } AssertFlushedPendingReflows(); - aWidth = mInnerFrame->GetSize().width; + aWidth = mInnerFrame->GetPhysicalSize().width; return true; } bool nsComputedDOMStyle::GetFrameBorderRectHeight(nscoord& aHeight) { if (!mInnerFrame) { return false; } AssertFlushedPendingReflows(); - aHeight = mInnerFrame->GetSize().height; + aHeight = mInnerFrame->GetPhysicalSize().height; return true; } bool nsComputedDOMStyle::GetFrameBoundsWidthForTransform(nscoord& aWidth) { // We need a frame to work with. if (!mInnerFrame) { diff --git a/layout/style/nsMediaFeatures.cpp b/layout/style/nsMediaFeatures.cpp --- a/layout/style/nsMediaFeatures.cpp +++ b/layout/style/nsMediaFeatures.cpp @@ -60,42 +60,42 @@ const OperatingSystemVersionInfo osVersi { LookAndFeel::eOperatingSystemVersion_WindowsVista, L"windows-vista" }, { LookAndFeel::eOperatingSystemVersion_Windows7, L"windows-win7" }, { LookAndFeel::eOperatingSystemVersion_Windows8, L"windows-win8" }, }; #endif // A helper for four features below static nsSize -GetSize(nsPresContext* aPresContext) +GetPhysicalSize(nsPresContext* aPresContext) { nsSize size; if (aPresContext->IsRootPaginatedDocument()) // We want the page size, including unprintable areas and margins. size = aPresContext->GetPageSize(); else size = aPresContext->GetVisibleArea().Size(); return size; } static nsresult GetWidth(nsPresContext* aPresContext, const nsMediaFeature*, nsCSSValue& aResult) { - nsSize size = GetSize(aPresContext); + nsSize size = GetPhysicalSize(aPresContext); float pixelWidth = aPresContext->AppUnitsToFloatCSSPixels(size.width); aResult.SetFloatValue(pixelWidth, eCSSUnit_Pixel); return NS_OK; } static nsresult GetHeight(nsPresContext* aPresContext, const nsMediaFeature*, nsCSSValue& aResult) { - nsSize size = GetSize(aPresContext); + nsSize size = GetPhysicalSize(aPresContext); float pixelHeight = aPresContext->AppUnitsToFloatCSSPixels(size.height); aResult.SetFloatValue(pixelHeight, eCSSUnit_Pixel); return NS_OK; } inline static nsDeviceContext* GetDeviceContextFor(nsPresContext* aPresContext) { @@ -142,17 +142,17 @@ GetDeviceHeight(nsPresContext* aPresCont aResult.SetFloatValue(pixelHeight, eCSSUnit_Pixel); return NS_OK; } static nsresult GetOrientation(nsPresContext* aPresContext, const nsMediaFeature*, nsCSSValue& aResult) { - nsSize size = GetSize(aPresContext); + nsSize size = GetPhysicalSize(aPresContext); int32_t orientation; if (size.width > size.height) { orientation = NS_STYLE_ORIENTATION_LANDSCAPE; } else { // Per spec, square viewports should be 'portrait' orientation = NS_STYLE_ORIENTATION_PORTRAIT; } @@ -198,17 +198,17 @@ MakeArray(const nsSize& aSize, nsCSSValu aResult.SetArrayValue(a, eCSSUnit_Array); return NS_OK; } static nsresult GetAspectRatio(nsPresContext* aPresContext, const nsMediaFeature*, nsCSSValue& aResult) { - return MakeArray(GetSize(aPresContext), aResult); + return MakeArray(GetPhysicalSize(aPresContext), aResult); } static nsresult GetDeviceAspectRatio(nsPresContext* aPresContext, const nsMediaFeature*, nsCSSValue& aResult) { return MakeArray(GetDeviceSize(aPresContext), aResult); } diff --git a/layout/svg/nsSVGFilterFrame.cpp b/layout/svg/nsSVGFilterFrame.cpp --- a/layout/svg/nsSVGFilterFrame.cpp +++ b/layout/svg/nsSVGFilterFrame.cpp @@ -84,17 +84,17 @@ GetUserToFrameSpaceInCSSPxTransform(nsIF // frame type for which these extra transforms are not simply an x/y // translation is nsSVGInnerSVGFrame, hence we treat it specially here. if (aFrame->GetType() == nsGkAtoms::svgInnerSVGFrame) { userToFrameSpaceInCSSPx = static_cast(aFrame->GetContent())-> PrependLocalTransformsTo(gfxMatrix()); } else { gfxPoint targetsUserSpaceOffset = - nsLayoutUtils::RectToGfxRect(aFrame->GetRect(), appUnitsPerCSSPx). + nsLayoutUtils::RectToGfxRect(aFrame->GetPhysicalRect(), appUnitsPerCSSPx). TopLeft(); userToFrameSpaceInCSSPx.Translate(-targetsUserSpaceOffset); } } // else, for all other frames, leave as the identity matrix return userToFrameSpaceInCSSPx; } diff --git a/layout/svg/nsSVGForeignObjectFrame.cpp b/layout/svg/nsSVGForeignObjectFrame.cpp --- a/layout/svg/nsSVGForeignObjectFrame.cpp +++ b/layout/svg/nsSVGForeignObjectFrame.cpp @@ -133,18 +133,18 @@ nsSVGForeignObjectFrame::Reflow(nsPresCo // reflow root's parent anyway. NS_ASSERTION(!(GetStateBits() & NS_FRAME_IS_DIRTY), "Reflowing while a resize is pending is wasteful"); // ReflowSVG makes sure mRect is up to date before we're called. NS_ASSERTION(!aReflowState.parentReflowState, "should only get reflow from being reflow root"); - NS_ASSERTION(aReflowState.ComputedWidth() == GetSize().width && - aReflowState.ComputedHeight() == GetSize().height, + NS_ASSERTION(aReflowState.ComputedWidth() == GetPhysicalSize().width && + aReflowState.ComputedHeight() == GetPhysicalSize().height, "reflow roots should be reflowed at existing size and " "svg.css should ensure we have no padding/border/margin"); DoReflow(); aDesiredSize.width = aReflowState.ComputedWidth(); aDesiredSize.height = aReflowState.ComputedHeight(); aDesiredSize.SetOverflowAreasToDesiredBounds(); diff --git a/layout/svg/nsSVGGlyphFrame.cpp b/layout/svg/nsSVGGlyphFrame.cpp --- a/layout/svg/nsSVGGlyphFrame.cpp +++ b/layout/svg/nsSVGGlyphFrame.cpp @@ -226,32 +226,32 @@ public: }; void nsDisplaySVGGlyphs::HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect, HitTestState* aState, nsTArray *aOutFrames) { nsSVGGlyphFrame *frame = static_cast(mFrame); nsPoint pointRelativeToReferenceFrame = aRect.Center(); - // ToReferenceFrame() includes frame->GetPosition(), our user space position. + // ToReferenceFrame() includes frame->GetPhysicalPosition(), our user space position. nsPoint userSpacePt = pointRelativeToReferenceFrame - - (ToReferenceFrame() - frame->GetPosition()); + (ToReferenceFrame() - frame->GetPhysicalPosition()); if (frame->GetFrameForPoint(userSpacePt)) { aOutFrames->AppendElement(frame); } } void nsDisplaySVGGlyphs::Paint(nsDisplayListBuilder* aBuilder, nsRenderingContext* aCtx) { // ToReferenceFrame includes our mRect offset, but painting takes // account of that too. To avoid double counting, we subtract that // here. - nsPoint offset = ToReferenceFrame() - mFrame->GetPosition(); + nsPoint offset = ToReferenceFrame() - mFrame->GetPhysicalPosition(); aCtx->PushState(); aCtx->Translate(offset); static_cast(mFrame)->PaintSVG(aCtx, nullptr); aCtx->PopState(); } //---------------------------------------------------------------------- diff --git a/layout/svg/nsSVGIntegrationUtils.cpp b/layout/svg/nsSVGIntegrationUtils.cpp --- a/layout/svg/nsSVGIntegrationUtils.cpp +++ b/layout/svg/nsSVGIntegrationUtils.cpp @@ -358,17 +358,17 @@ nsSVGIntegrationUtils::GetRequiredSource bool nsSVGIntegrationUtils::HitTestFrameForEffects(nsIFrame* aFrame, const nsPoint& aPt) { nsIFrame* firstFrame = nsLayoutUtils::GetFirstContinuationOrSpecialSibling(aFrame); // Convert aPt to user space: nsPoint toUserSpace; if (aFrame->GetStateBits() & NS_FRAME_SVG_LAYOUT) { - toUserSpace = aFrame->GetPosition(); + toUserSpace = aFrame->GetPhysicalPosition(); } else { toUserSpace = aFrame->GetOffsetTo(firstFrame) + GetOffsetToUserSpace(firstFrame); } nsPoint pt = aPt + toUserSpace; return nsSVGUtils::HitTestClip(firstFrame, pt); } @@ -478,17 +478,17 @@ nsSVGIntegrationUtils::PaintFramesWithEf aFrame->PresContext()->RoundAppUnitsToNearestDevPixels(offset.x), aFrame->PresContext()->RoundAppUnitsToNearestDevPixels(offset.y)); } nsPoint svgGeomFramePos; if (aFrame->IsFrameOfType(nsIFrame::eSVGGeometry) || aFrame->IsSVGText()) { // SVG leaf frames apply their offset themselves, we need to unapply it at // various points below to prevent it being double counted. - svgGeomFramePos = aFrame->GetPosition(); + svgGeomFramePos = aFrame->GetPhysicalPosition(); offsetWithoutSVGGeomFramePos -= svgGeomFramePos; } aCtx->Translate(offsetWithoutSVGGeomFramePos); gfxMatrix cssPxToDevPxMatrix = GetCSSPxToDevPxMatrix(aFrame); bool complexEffects = false; diff --git a/layout/svg/nsSVGOuterSVGFrame.cpp b/layout/svg/nsSVGOuterSVGFrame.cpp --- a/layout/svg/nsSVGOuterSVGFrame.cpp +++ b/layout/svg/nsSVGOuterSVGFrame.cpp @@ -510,17 +510,17 @@ nsSVGOuterSVGFrame::Reflow(nsPresContext // // WARNING!! Keep UpdateBounds below in sync with whatever we do for our // overflow rects here! (Again, see bug 875175.) // aDesiredSize.SetOverflowAreasToDesiredBounds(); if (!mIsRootContent) { aDesiredSize.mOverflowAreas.VisualOverflow().UnionRect( aDesiredSize.mOverflowAreas.VisualOverflow(), - anonKid->GetVisualOverflowRect() + anonKid->GetPosition()); + anonKid->GetVisualOverflowRect() + anonKid->GetPhysicalPosition()); } FinishAndStoreOverflow(&aDesiredSize); NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS, ("exit nsSVGOuterSVGFrame::Reflow: size=%d,%d", aDesiredSize.width, aDesiredSize.height)); NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize); return NS_OK; @@ -542,27 +542,27 @@ nsSVGOuterSVGFrame::DidReflow(nsPresCont /* virtual */ bool nsSVGOuterSVGFrame::UpdateOverflow() { // See the comments in Reflow above. // WARNING!! Keep this in sync with Reflow above! - nsRect rect(nsPoint(0, 0), GetSize()); + nsRect rect(nsPoint(0, 0), GetPhysicalSize()); nsOverflowAreas overflowAreas(rect, rect); if (!mIsRootContent) { nsIFrame *anonKid = GetFirstPrincipalChild(); overflowAreas.VisualOverflow().UnionRect( overflowAreas.VisualOverflow(), - anonKid->GetVisualOverflowRect() + anonKid->GetPosition()); + anonKid->GetVisualOverflowRect() + anonKid->GetPhysicalPosition()); } - return FinishAndStoreOverflow(overflowAreas, GetSize()); + return FinishAndStoreOverflow(overflowAreas, GetPhysicalSize()); } //---------------------------------------------------------------------- // container methods /** * Used to paint/hit-test SVG when SVG display lists are disabled. @@ -593,28 +593,28 @@ public: }; void nsDisplayOuterSVG::HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect, HitTestState* aState, nsTArray *aOutFrames) { nsSVGOuterSVGFrame *outerSVGFrame = static_cast(mFrame); nsRect rectAtOrigin = aRect - ToReferenceFrame(); - nsRect thisRect(nsPoint(0,0), outerSVGFrame->GetSize()); + nsRect thisRect(nsPoint(0,0), outerSVGFrame->GetPhysicalSize()); if (!thisRect.Intersects(rectAtOrigin)) return; nsPoint rectCenter(rectAtOrigin.x + rectAtOrigin.width / 2, rectAtOrigin.y + rectAtOrigin.height / 2); nsSVGOuterSVGAnonChildFrame *anonKid = static_cast( outerSVGFrame->GetFirstPrincipalChild()); nsIFrame* frame = nsSVGUtils::HitTestChildren( - anonKid, rectCenter + outerSVGFrame->GetPosition() - + anonKid, rectCenter + outerSVGFrame->GetPhysicalPosition() - outerSVGFrame->GetContentRect().TopLeft()); if (frame) { aOutFrames->AppendElement(frame); } } void nsDisplayOuterSVG::Paint(nsDisplayListBuilder* aBuilder, diff --git a/layout/svg/nsSVGOuterSVGFrame.h b/layout/svg/nsSVGOuterSVGFrame.h --- a/layout/svg/nsSVGOuterSVGFrame.h +++ b/layout/svg/nsSVGOuterSVGFrame.h @@ -207,27 +207,27 @@ protected: // nsSVGOuterSVGAnonChildFrame class typedef nsSVGDisplayContainerFrame nsSVGOuterSVGAnonChildFrameBase; /** * nsSVGOuterSVGFrames have a single direct child that is an instance of this * class, and which is used to wrap their real child frames. Such anonymous * wrapper frames created from this class exist because SVG frames need their - * GetPosition() offset to be their offset relative to "user space" (in app + * GetPhysicalPosition() offset to be their offset relative to "user space" (in app * units) so that they can play nicely with nsDisplayTransform. This is fine * for all SVG frames except for direct children of an nsSVGOuterSVGFrame, * since an nsSVGOuterSVGFrame can have CSS border and padding (unlike other * SVG frames). The direct children can't include the offsets due to any such * border/padding in their mRects since that would break nsDisplayTransform, * but not including these offsets would break other parts of the Mozilla code * that assume a frame's mRect contains its border-box-to-parent-border-box * offset, in particular nsIFrame::GetOffsetTo and the functions that depend on * it. Wrapping an nsSVGOuterSVGFrame's children in an instance of this class - * with its GetPosition() set to its nsSVGOuterSVGFrame's border/padding offset + * with its GetPhysicalPosition() set to its nsSVGOuterSVGFrame's border/padding offset * keeps both nsDisplayTransform and nsIFrame::GetOffsetTo happy. * * The reason that this class inherit from nsSVGDisplayContainerFrame rather * than simply from nsContainerFrame is so that we can avoid having special * handling for these inner wrappers in multiple parts of the SVG code. For * example, the implementations of IsSVGTransformed and GetCanvasTM assume * nsSVGContainerFrame instances all the way up to the nsSVGOuterSVGFrame. */ diff --git a/layout/svg/nsSVGPathGeometryFrame.cpp b/layout/svg/nsSVGPathGeometryFrame.cpp --- a/layout/svg/nsSVGPathGeometryFrame.cpp +++ b/layout/svg/nsSVGPathGeometryFrame.cpp @@ -70,32 +70,32 @@ public: }; void nsDisplaySVGPathGeometry::HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect, HitTestState* aState, nsTArray *aOutFrames) { nsSVGPathGeometryFrame *frame = static_cast(mFrame); nsPoint pointRelativeToReferenceFrame = aRect.Center(); - // ToReferenceFrame() includes frame->GetPosition(), our user space position. + // ToReferenceFrame() includes frame->GetPhysicalPosition(), our user space position. nsPoint userSpacePt = pointRelativeToReferenceFrame - - (ToReferenceFrame() - frame->GetPosition()); + (ToReferenceFrame() - frame->GetPhysicalPosition()); if (frame->GetFrameForPoint(userSpacePt)) { aOutFrames->AppendElement(frame); } } void nsDisplaySVGPathGeometry::Paint(nsDisplayListBuilder* aBuilder, nsRenderingContext* aCtx) { // ToReferenceFrame includes our mRect offset, but painting takes // account of that too. To avoid double counting, we subtract that // here. - nsPoint offset = ToReferenceFrame() - mFrame->GetPosition(); + nsPoint offset = ToReferenceFrame() - mFrame->GetPhysicalPosition(); aCtx->PushState(); aCtx->Translate(offset); static_cast(mFrame)->PaintSVG(aCtx, nullptr); aCtx->PopState(); } //---------------------------------------------------------------------- diff --git a/layout/svg/nsSVGTextFrame2.cpp b/layout/svg/nsSVGTextFrame2.cpp --- a/layout/svg/nsSVGTextFrame2.cpp +++ b/layout/svg/nsSVGTextFrame2.cpp @@ -799,17 +799,17 @@ TextRenderedRun::GetTransformFromUserSpa // Rotation due to rotate="" or a . m.Rotate(mRotate); m.Scale(mLengthAdjustScaleFactor, 1.0); // Translation to get the text frame in the right place. nsPoint t(IsRightToLeft() ? - -mFrame->GetRect().width + aItem.mRightEdge : + -mFrame->GetPhysicalRect().width + aItem.mRightEdge : -aItem.mLeftEdge, -mBaseline); m.Translate(AppUnitsToGfxUnits(t, aContext)); return m; } gfxMatrix @@ -833,17 +833,17 @@ TextRenderedRun::GetTransformFromRunUser // Rotation due to rotate="" or a . m.Rotate(mRotate); // Scale due to textLength="". m.Scale(mLengthAdjustScaleFactor, 1.0); // Translation to get the text frame in the right place. nsPoint t(IsRightToLeft() ? - -mFrame->GetRect().width + left + right : + -mFrame->GetPhysicalRect().width + left + right : 0, -mBaseline); m.Translate(AppUnitsToGfxUnits(t, aContext) * cssPxPerDevPx / mFontSizeScaleFactor); return m; } @@ -876,17 +876,17 @@ TextRenderedRun::GetRunUserSpaceRect(nsP // Determine the amount of overflow above and below the frame's mRect. // // We need to call GetVisualOverflowRectRelativeToSelf because this includes // overflowing decorations, which the MeasureText call below does not. We // assume here the decorations only overflow above and below the frame, never // horizontally. nsRect self = mFrame->GetVisualOverflowRectRelativeToSelf(); - nsRect rect = mFrame->GetRect(); + nsRect rect = mFrame->GetPhysicalRect(); nscoord above = -self.y; nscoord below = self.YMost() - rect.height; gfxSkipCharsIterator it = mFrame->EnsureTextRun(nsTextFrame::eInflated); gfxTextRun* textRun = mFrame->GetTextRun(nsTextFrame::eInflated); // Get the content range for this rendered run. uint32_t offset, length; @@ -1685,17 +1685,17 @@ TextFrameIterator::Next() // encounter mSubtree. if (mCurrentFrame) { do { nsIFrame* next = IsTextContentElement(mCurrentFrame->GetContent()) ? mCurrentFrame->GetFirstPrincipalChild() : nullptr; if (next) { // Descend into this frame, and accumulate its position. - mCurrentPosition += next->GetPosition(); + mCurrentPosition += next->GetPhysicalPosition(); if (next->GetContent()->Tag() == nsGkAtoms::textPath) { // Record this frame. mTextPathFrames.AppendElement(next); } // Record the frame's baseline. PushBaseline(next); mCurrentFrame = next; if (mCurrentFrame == mSubtree) { @@ -1706,31 +1706,31 @@ TextFrameIterator::Next() for (;;) { // We want to move past the current frame. if (mCurrentFrame == mRootFrame) { // If we've reached the root frame, we're finished. mCurrentFrame = nullptr; break; } // Remove the current frame's position. - mCurrentPosition -= mCurrentFrame->GetPosition(); + mCurrentPosition -= mCurrentFrame->GetPhysicalPosition(); if (mCurrentFrame->GetContent()->Tag() == nsGkAtoms::textPath) { // Pop off the frame if this is a . mTextPathFrames.TruncateLength(mTextPathFrames.Length() - 1); } // Pop off the current baseline. PopBaseline(); if (mCurrentFrame == mSubtree) { // If this was mSubtree, we have now moved past it. mSubtreePosition = eAfterSubtree; } next = mCurrentFrame->GetNextSibling(); if (next) { // Moving to the next sibling. - mCurrentPosition += next->GetPosition(); + mCurrentPosition += next->GetPhysicalPosition(); if (next->GetContent()->Tag() == nsGkAtoms::textPath) { // Record this frame. mTextPathFrames.AppendElement(next); } // Record the frame's baseline. PushBaseline(next); mCurrentFrame = next; if (mCurrentFrame == mSubtree) { @@ -2994,34 +2994,34 @@ public: }; void nsDisplaySVGText::HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect, HitTestState* aState, nsTArray *aOutFrames) { nsSVGTextFrame2 *frame = static_cast(mFrame); nsPoint pointRelativeToReferenceFrame = aRect.Center(); - // ToReferenceFrame() includes frame->GetPosition(), our user space position. + // ToReferenceFrame() includes frame->GetPhysicalPosition(), our user space position. nsPoint userSpacePt = pointRelativeToReferenceFrame - - (ToReferenceFrame() - frame->GetPosition()); + (ToReferenceFrame() - frame->GetPhysicalPosition()); nsIFrame* target = frame->GetFrameForPoint(userSpacePt); if (target) { aOutFrames->AppendElement(target); } } void nsDisplaySVGText::Paint(nsDisplayListBuilder* aBuilder, nsRenderingContext* aCtx) { // ToReferenceFrame includes our mRect offset, but painting takes // account of that too. To avoid double counting, we subtract that // here. - nsPoint offset = ToReferenceFrame() - mFrame->GetPosition(); + nsPoint offset = ToReferenceFrame() - mFrame->GetPhysicalPosition(); aCtx->PushState(); aCtx->Translate(offset); static_cast(mFrame)->PaintSVG(aCtx, nullptr); aCtx->PopState(); } // --------------------------------------------------------------------- @@ -4387,17 +4387,17 @@ nsSVGTextFrame2::DetermineCharPositions( TextFrameIterator frit(this); for (nsTextFrame* frame = frit.Current(); frame; frame = frit.Next()) { gfxSkipCharsIterator it = frame->EnsureTextRun(nsTextFrame::eInflated); gfxTextRun* textRun = frame->GetTextRun(nsTextFrame::eInflated); // Reset the position to the new frame's position. position = frit.Position(); if (textRun->IsRightToLeft()) { - position.x += frame->GetRect().width; + position.x += frame->GetPhysicalRect().width; } position.y += GetBaselinePosition(frame, textRun, frit.DominantBaseline()); // Any characters not in a frame, e.g. when display:none. for (uint32_t i = 0; i < frit.UndisplayedCharacters(); i++) { aPositions.AppendElement(position); } @@ -4845,17 +4845,17 @@ nsSVGTextFrame2::DoGlyphPositioning() AppUnitsToFloatCSSPixels(presContext->AppUnitsPerDevPixel()); double factor = cssPxPerDevPx / mFontSizeScaleFactor; // Determine how much to compress or expand glyph positions due to // textLength="" and lengthAdjust="". double adjustment = 0.0; mLengthAdjustScaleFactor = 1.0f; if (adjustingTextLength) { - nscoord frameWidth = GetFirstPrincipalChild()->GetRect().width; + nscoord frameWidth = GetFirstPrincipalChild()->GetPhysicalRect().width; float actualTextLength = static_cast(presContext->AppUnitsToGfxUnits(frameWidth) * factor); nsRefPtr lengthAdjustEnum = element->LengthAdjust(); uint16_t lengthAdjust = lengthAdjustEnum->AnimVal(); switch (lengthAdjust) { case SVG_LENGTHADJUST_SPACINGANDGLYPHS: // Scale the glyphs and their positions. diff --git a/layout/svg/nsSVGUtils.cpp b/layout/svg/nsSVGUtils.cpp --- a/layout/svg/nsSVGUtils.cpp +++ b/layout/svg/nsSVGUtils.cpp @@ -781,19 +781,19 @@ nsSVGUtils::PaintFrameWithEffects(nsRend !(aFrame->GetStateBits() & NS_FRAME_IS_NONDISPLAY)) { // Here we convert aFrame's paint bounds to outer- device space, // compare it to aDirtyRect, and return early if they don't intersect. // We don't do this optimization for nondisplay SVG since nondisplay // SVG doesn't maintain bounds/overflow rects. nsRect overflowRect = aFrame->GetVisualOverflowRectRelativeToSelf(); if (aFrame->IsFrameOfType(nsIFrame::eSVGGeometry) || aFrame->IsSVGText()) { - // Unlike containers, leaf frames do not include GetPosition() in + // Unlike containers, leaf frames do not include GetPhysicalPosition() in // GetCanvasTM(). - overflowRect = overflowRect + aFrame->GetPosition(); + overflowRect = overflowRect + aFrame->GetPhysicalPosition(); } int32_t appUnitsPerDevPx = aFrame->PresContext()->AppUnitsPerDevPixel(); gfxMatrix tm = GetCanvasTM(aFrame, nsISVGChildFrame::FOR_PAINTING, aTransformRoot); if (aFrame->IsFrameOfType(nsIFrame::eSVG | nsIFrame::eSVGContainer)) { gfxMatrix childrenOnlyTM; if (static_cast(aFrame)-> HasChildrenOnlyTransform(&childrenOnlyTM)) { // Undo the children-only transform: @@ -853,19 +853,19 @@ nsSVGUtils::PaintFrameWithEffects(nsRend if (!(aFrame->GetStateBits() & NS_FRAME_IS_NONDISPLAY)) { // aFrame has a valid visual overflow rect, so clip to it before calling // PushGroup() to minimize the size of the surfaces we'll composite: gfxContextMatrixAutoSaveRestore matrixAutoSaveRestore(gfx); gfx->Multiply(GetCanvasTM(aFrame, nsISVGChildFrame::FOR_PAINTING, aTransformRoot)); nsRect overflowRect = aFrame->GetVisualOverflowRectRelativeToSelf(); if (aFrame->IsFrameOfType(nsIFrame::eSVGGeometry) || aFrame->IsSVGText()) { - // Unlike containers, leaf frames do not include GetPosition() in + // Unlike containers, leaf frames do not include GetPhysicalPosition() in // GetCanvasTM(). - overflowRect = overflowRect + aFrame->GetPosition(); + overflowRect = overflowRect + aFrame->GetPhysicalPosition(); } aContext->IntersectClip(overflowRect); } gfx->PushGroup(gfxASurface::CONTENT_COLOR_ALPHA); } /* If this frame has only a trivial clipPath, set up cairo's clipping now so * we can just do normal painting and get it clipped appropriately. @@ -890,17 +890,17 @@ nsSVGUtils::PaintFrameWithEffects(nsRend gfxMatrix deviceToUserSpace = userToDeviceSpace; deviceToUserSpace.Invert(); gfxRect dirtyBounds = deviceToUserSpace.TransformBounds( gfxRect(aDirtyRect->x, aDirtyRect->y, aDirtyRect->width, aDirtyRect->height)); tmpDirtyRect = nsLayoutUtils::RoundGfxRectToAppRect( dirtyBounds, aFrame->PresContext()->AppUnitsPerCSSPixel()) - - aFrame->GetPosition(); + aFrame->GetPhysicalPosition(); dirtyRect = &tmpDirtyRect; } SVGPaintCallback paintCallback; filterFrame->PaintFilteredFrame(aContext, aFrame, &paintCallback, dirtyRect, aTransformRoot); } else { svgChildFrame->PaintSVG(aContext, aDirtyRect, aTransformRoot); } diff --git a/layout/tables/nsTableCellFrame.cpp b/layout/tables/nsTableCellFrame.cpp --- a/layout/tables/nsTableCellFrame.cpp +++ b/layout/tables/nsTableCellFrame.cpp @@ -257,17 +257,17 @@ nsTableCellFrame::RemoveFrame(ChildListI } void nsTableCellFrame::SetColIndex(int32_t aColIndex) { mColIndex = aColIndex; } /* virtual */ nsMargin -nsTableCellFrame::GetUsedMargin() const +nsTableCellFrame::GetUsedPhysicalMargin() const { return nsMargin(0,0,0,0); } //ASSURE DIFFERENT COLORS for selection inline nscolor EnsureDifferentColors(nscolor colorA, nscolor colorB) { if (colorA == colorB) @@ -331,17 +331,17 @@ nsTableCellFrame::DecorateForSelection(n } void nsTableCellFrame::PaintBackground(nsRenderingContext& aRenderingContext, const nsRect& aDirtyRect, nsPoint aPt, uint32_t aFlags) { - nsRect rect(aPt, GetSize()); + nsRect rect(aPt, GetPhysicalSize()); nsCSSRendering::PaintBackground(PresContext(), aRenderingContext, this, aDirtyRect, rect, aFlags); } // Called by nsTablePainter void nsTableCellFrame::PaintCellBackground(nsRenderingContext& aRenderingContext, const nsRect& aDirtyRect, nsPoint aPt, @@ -410,26 +410,26 @@ nsDisplayTableCellBackground::ComputeInv } nsDisplayTableItem::ComputeInvalidationRegion(aBuilder, aGeometry, aInvalidRegion); } void nsTableCellFrame::InvalidateFrame(uint32_t aDisplayItemKey) { nsIFrame::InvalidateFrame(aDisplayItemKey); - GetParent()->InvalidateFrameWithRect(GetVisualOverflowRect() + GetPosition(), aDisplayItemKey); + GetParent()->InvalidateFrameWithRect(GetVisualOverflowRect() + GetPhysicalPosition(), aDisplayItemKey); } void nsTableCellFrame::InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey) { nsIFrame::InvalidateFrameWithRect(aRect, aDisplayItemKey); // If we have filters applied that would affects our bounds, then // we get an inactive layer created and this is computed // within FrameLayerBuilder - GetParent()->InvalidateFrameWithRect(aRect + GetPosition(), aDisplayItemKey); + GetParent()->InvalidateFrameWithRect(aRect + GetPhysicalPosition(), aDisplayItemKey); } static void PaintTableCellSelection(nsIFrame* aFrame, nsRenderingContext* aCtx, const nsRect& aRect, nsPoint aPt) { static_cast(aFrame)->DecorateForSelection(*aCtx, aPt); } @@ -540,27 +540,27 @@ nsTableCellFrame::GetBorderOverflow() return nsMargin(0, 0, 0, 0); } // Align the cell's child frame within the cell void nsTableCellFrame::VerticallyAlignChild(nscoord aMaxAscent) { /* It's the 'border-collapse' on the table that matters */ - nsMargin borderPadding = GetUsedBorderAndPadding(); + nsMargin borderPadding = GetUsedPhysicalBorderAndPadding(); nscoord topInset = borderPadding.top; nscoord bottomInset = borderPadding.bottom; uint8_t verticalAlignFlags = GetVerticalAlign(); nscoord height = mRect.height; nsIFrame* firstKid = mFrames.FirstChild(); NS_ASSERTION(firstKid, "Frame construction error, a table cell always has an inner cell frame"); - nsRect kidRect = firstKid->GetRect(); + nsRect kidRect = firstKid->GetPhysicalRect(); nscoord childHeight = kidRect.height; // Vertically align the child nscoord kidYTop = 0; switch (verticalAlignFlags) { case NS_STYLE_VERTICAL_ALIGN_BASELINE: // Align the baselines of the child frame with the baselines of @@ -591,17 +591,17 @@ void nsTableCellFrame::VerticallyAlignCh firstKid->InvalidateFrameSubtree(); } firstKid->SetPosition(nsPoint(kidRect.x, kidYTop)); nsHTMLReflowMetrics desiredSize; desiredSize.width = mRect.width; desiredSize.height = mRect.height; - nsRect overflow(nsPoint(0,0), GetSize()); + nsRect overflow(nsPoint(0,0), GetPhysicalSize()); overflow.Inflate(GetBorderOverflow()); desiredSize.mOverflowAreas.SetAllTo(overflow); ConsiderChildOverflow(desiredSize.mOverflowAreas, firstKid); FinishAndStoreOverflow(&desiredSize); if (kidYTop != kidRect.y) { // Make sure any child views are correctly positioned. We know the inner table // cell won't have a view nsContainerFrame::PositionChildViews(firstKid); @@ -614,23 +614,23 @@ void nsTableCellFrame::VerticallyAlignCh GetView(), desiredSize.VisualOverflow(), 0); } } bool nsTableCellFrame::UpdateOverflow() { - nsRect bounds(nsPoint(0,0), GetSize()); + nsRect bounds(nsPoint(0,0), GetPhysicalSize()); bounds.Inflate(GetBorderOverflow()); nsOverflowAreas overflowAreas(bounds, bounds); nsLayoutUtils::UnionChildOverflow(this, overflowAreas); - return FinishAndStoreOverflow(overflowAreas, GetSize()); + return FinishAndStoreOverflow(overflowAreas, GetPhysicalSize()); } // Per CSS 2.1, we map 'sub', 'super', 'text-top', 'text-bottom', // length, percentage, and calc() values to 'baseline'. uint8_t nsTableCellFrame::GetVerticalAlign() const { const nsStyleCoord& verticalAlign = StyleTextReset()->mVerticalAlign; @@ -677,21 +677,21 @@ nsTableCellFrame::CellHasVisibleContent( } nscoord nsTableCellFrame::GetCellBaseline() const { // Ignore the position of the inner frame relative to the cell frame // since we want the position as though the inner were top-aligned. nsIFrame *inner = mFrames.FirstChild(); - nscoord borderPadding = GetUsedBorderAndPadding().top; + nscoord borderPadding = GetUsedPhysicalBorderAndPadding().top; nscoord result; if (nsLayoutUtils::GetFirstLineBaseline(inner, &result)) return result + borderPadding; - return inner->GetContentRect().YMost() - inner->GetPosition().y + + return inner->GetContentRect().YMost() - inner->GetPhysicalPosition().y + borderPadding; } int32_t nsTableCellFrame::GetRowSpan() { int32_t rowSpan=1; nsGenericHTMLElement *hc = nsGenericHTMLElement::FromContent(mContent); @@ -893,17 +893,17 @@ NS_METHOD nsTableCellFrame::Reflow(nsPre (GetFirstInFlow()->GetStateBits() & NS_TABLE_CELL_HAD_SPECIAL_REFLOW)) { // We need to force the kid to have mVResize set if we've had a // special reflow in the past, since the non-special reflow needs to // resize back to what it was without the special height reflow. kidReflowState.mFlags.mVResize = true; } nsPoint kidOrigin(leftInset, topInset); - nsRect origRect = firstKid->GetRect(); + nsRect origRect = firstKid->GetPhysicalRect(); nsRect origVisualOverflow = firstKid->GetVisualOverflowRect(); bool firstReflow = (firstKid->GetStateBits() & NS_FRAME_FIRST_REFLOW) != 0; ReflowChild(firstKid, aPresContext, kidSize, kidReflowState, kidOrigin.x, kidOrigin.y, 0, aStatus); if (NS_FRAME_OVERFLOW_IS_INCOMPLETE(aStatus)) { // Don't pass OVERFLOW_INCOMPLETE through tables until they can actually handle it //XXX should paginate overflow as overflow, but not in this patch (bug 379349) @@ -1062,17 +1062,17 @@ nsBCTableCellFrame::~nsBCTableCellFrame( nsIAtom* nsBCTableCellFrame::GetType() const { return nsGkAtoms::bcTableCellFrame; } /* virtual */ nsMargin -nsBCTableCellFrame::GetUsedBorder() const +nsBCTableCellFrame::GetUsedPhysicalBorder() const { nsMargin result; GetBorderWidth(result); return result; } /* virtual */ bool nsBCTableCellFrame::GetBorderRadii(nscoord aRadii[8]) const @@ -1166,17 +1166,17 @@ nsBCTableCellFrame::PaintBackground(nsRe #ifdef DEBUG myBorder.mImageTracked = StyleBorder()->mImageTracked; #endif NS_FOR_CSS_SIDES(side) { myBorder.SetBorderWidth(side, borderWidth.Side(side)); } - nsRect rect(aPt, GetSize()); + nsRect rect(aPt, GetPhysicalSize()); // bypassing nsCSSRendering::PaintBackground is safe because this kind // of frame cannot be used for the root element nsCSSRendering::PaintBackgroundWithSC(PresContext(), aRenderingContext, this, aDirtyRect, rect, StyleContext(), myBorder, aFlags, nullptr); #ifdef DEBUG diff --git a/layout/tables/nsTableCellFrame.h b/layout/tables/nsTableCellFrame.h --- a/layout/tables/nsTableCellFrame.h +++ b/layout/tables/nsTableCellFrame.h @@ -75,17 +75,17 @@ public: nsFrameList& aFrameList) MOZ_OVERRIDE; NS_IMETHOD RemoveFrame(ChildListID aListID, nsIFrame* aOldFrame) MOZ_OVERRIDE; virtual nsIFrame* GetContentInsertionFrame() MOZ_OVERRIDE { return GetFirstPrincipalChild()->GetContentInsertionFrame(); } - virtual nsMargin GetUsedMargin() const MOZ_OVERRIDE; + virtual nsMargin GetUsedPhysicalMargin() const MOZ_OVERRIDE; virtual void NotifyPercentHeight(const nsHTMLReflowState& aReflowState) MOZ_OVERRIDE; virtual bool NeedsToObserve(const nsHTMLReflowState& aReflowState) MOZ_OVERRIDE; /** instantiate a new instance of nsTableRowFrame. * @param aPresShell the pres shell for this frame * @@ -292,17 +292,17 @@ public: NS_DECL_FRAMEARENA_HELPERS nsBCTableCellFrame(nsStyleContext* aContext); ~nsBCTableCellFrame(); virtual nsIAtom* GetType() const MOZ_OVERRIDE; - virtual nsMargin GetUsedBorder() const MOZ_OVERRIDE; + virtual nsMargin GetUsedPhysicalBorder() const MOZ_OVERRIDE; virtual bool GetBorderRadii(nscoord aRadii[8]) const MOZ_OVERRIDE; // Get the *inner half of the border only*, in twips. virtual nsMargin* GetBorderWidth(nsMargin& aBorder) const MOZ_OVERRIDE; // Get the *inner half of the border only*, in pixels. BCPixelSize GetBorderWidth(mozilla::css::Side aSide) const; diff --git a/layout/tables/nsTableColFrame.cpp b/layout/tables/nsTableColFrame.cpp --- a/layout/tables/nsTableColFrame.cpp +++ b/layout/tables/nsTableColFrame.cpp @@ -188,22 +188,22 @@ nsTableColFrame::GetSplittableType() con { return NS_FRAME_NOT_SPLITTABLE; } void nsTableColFrame::InvalidateFrame(uint32_t aDisplayItemKey) { nsIFrame::InvalidateFrame(aDisplayItemKey); - GetParent()->InvalidateFrameWithRect(GetVisualOverflowRect() + GetPosition(), aDisplayItemKey); + GetParent()->InvalidateFrameWithRect(GetVisualOverflowRect() + GetPhysicalPosition(), aDisplayItemKey); } void nsTableColFrame::InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey) { nsIFrame::InvalidateFrameWithRect(aRect, aDisplayItemKey); // If we have filters applied that would affects our bounds, then // we get an inactive layer created and this is computed // within FrameLayerBuilder - GetParent()->InvalidateFrameWithRect(aRect + GetPosition(), aDisplayItemKey); + GetParent()->InvalidateFrameWithRect(aRect + GetPhysicalPosition(), aDisplayItemKey); } diff --git a/layout/tables/nsTableColGroupFrame.cpp b/layout/tables/nsTableColGroupFrame.cpp --- a/layout/tables/nsTableColGroupFrame.cpp +++ b/layout/tables/nsTableColGroupFrame.cpp @@ -462,27 +462,27 @@ nsTableColGroupFrame::GetType() const { return nsGkAtoms::tableColGroupFrame; } void nsTableColGroupFrame::InvalidateFrame(uint32_t aDisplayItemKey) { nsIFrame::InvalidateFrame(aDisplayItemKey); - GetParent()->InvalidateFrameWithRect(GetVisualOverflowRect() + GetPosition(), aDisplayItemKey); + GetParent()->InvalidateFrameWithRect(GetVisualOverflowRect() + GetPhysicalPosition(), aDisplayItemKey); } void nsTableColGroupFrame::InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey) { nsIFrame::InvalidateFrameWithRect(aRect, aDisplayItemKey); // If we have filters applied that would affects our bounds, then // we get an inactive layer created and this is computed // within FrameLayerBuilder - GetParent()->InvalidateFrameWithRect(aRect + GetPosition(), aDisplayItemKey); + GetParent()->InvalidateFrameWithRect(aRect + GetPhysicalPosition(), aDisplayItemKey); } #ifdef DEBUG NS_IMETHODIMP nsTableColGroupFrame::GetFrameName(nsAString& aResult) const { return MakeFrameName(NS_LITERAL_STRING("TableColGroup"), aResult); } diff --git a/layout/tables/nsTableFrame.cpp b/layout/tables/nsTableFrame.cpp --- a/layout/tables/nsTableFrame.cpp +++ b/layout/tables/nsTableFrame.cpp @@ -181,17 +181,17 @@ nsTableFrame::Init(nsIContent* aCon // Create the cell map if this frame is the first-in-flow. if (!aPrevInFlow) { mCellMap = new nsTableCellMap(*this, borderCollapse); } if (aPrevInFlow) { // set my width, because all frames in a table flow are the same width and // code in nsTableOuterFrame depends on this being set - mRect.width = aPrevInFlow->GetSize().width; + mRect.width = aPrevInFlow->GetPhysicalSize().width; } else { NS_ASSERTION(!mTableLayoutStrategy, "strategy was created before Init was called"); // create the strategy if (IsAutoLayout()) mTableLayoutStrategy = new BasicTableLayoutStrategy(this); else mTableLayoutStrategy = new FixedTableLayoutStrategy(this); @@ -1721,17 +1721,17 @@ NS_METHOD nsTableFrame::Reflow(nsPresCon if (aReflowState.ComputedHeight() != NS_UNCONSTRAINEDSIZE || // Also check mVResize, to handle the first Reflow preceding a // special height Reflow, when we've already had a special height // Reflow (where mComputedHeight would not be // NS_UNCONSTRAINEDSIZE, but without a style change in between). aReflowState.mFlags.mVResize) { // XXX Eventually, we should modify DistributeHeightToRows to use - // nsTableRowFrame::GetHeight instead of nsIFrame::GetSize().height. + // nsTableRowFrame::GetHeight instead of nsIFrame::GetPhysicalSize().height. // That way, it will make its calculations based on internal table // frame heights as they are before they ever had any extra height // distributed to them. In the meantime, this reflows all the // internal table frames, which restores them to their state before // DistributeHeightToRows was called. SetGeometryDirty(); } @@ -1779,17 +1779,17 @@ NS_METHOD nsTableFrame::Reflow(nsPresCon ReflowTable(aDesiredSize, aReflowState, aReflowState.availableHeight, lastChildReflowed, aStatus); if (lastChildReflowed && NS_FRAME_IS_NOT_COMPLETE(aStatus)) { // if there is an incomplete child, then set the desired height to include it but not the next one nsMargin borderPadding = GetChildAreaOffset(&aReflowState); aDesiredSize.height = borderPadding.bottom + GetCellSpacingY() + - lastChildReflowed->GetRect().YMost(); + lastChildReflowed->GetPhysicalRect().YMost(); } haveDesiredHeight = true; mutable_rs.mFlags.mSpecialHeightReflow = false; } } else { // Calculate the overflow area contribution from our children. @@ -1832,29 +1832,29 @@ NS_METHOD nsTableFrame::Reflow(nsPresCon FinishAndStoreOverflow(&aDesiredSize); NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize); return rv; } bool nsTableFrame::UpdateOverflow() { - nsRect bounds(nsPoint(0, 0), GetSize()); + nsRect bounds(nsPoint(0, 0), GetPhysicalSize()); // As above in Reflow, make sure the table overflow area includes the table // rect, and check for collapsed borders leaking out. if (!ShouldApplyOverflowClipping(this, StyleDisplay())) { nsMargin bcMargin = GetExcludedOuterBCBorder(); bounds.Inflate(bcMargin); } nsOverflowAreas overflowAreas(bounds, bounds); nsLayoutUtils::UnionChildOverflow(this, overflowAreas); - return FinishAndStoreOverflow(overflowAreas, GetSize()); + return FinishAndStoreOverflow(overflowAreas, GetPhysicalSize()); } nsresult nsTableFrame::ReflowTable(nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, nscoord aAvailHeight, nsIFrame*& aLastChildReflowed, nsReflowStatus& aStatus) @@ -2372,35 +2372,35 @@ nsTableFrame::RemoveFrame(ChildListID #ifdef DEBUG_TABLE_CELLMAP printf("=== TableFrame::RemoveFrame\n"); Dump(true, true, true); #endif return NS_OK; } /* virtual */ nsMargin -nsTableFrame::GetUsedBorder() const +nsTableFrame::GetUsedPhysicalBorder() const { if (!IsBorderCollapse()) - return nsContainerFrame::GetUsedBorder(); + return nsContainerFrame::GetUsedPhysicalBorder(); return GetIncludedOuterBCBorder(); } /* virtual */ nsMargin -nsTableFrame::GetUsedPadding() const +nsTableFrame::GetUsedPhysicalPadding() const { if (!IsBorderCollapse()) - return nsContainerFrame::GetUsedPadding(); + return nsContainerFrame::GetUsedPhysicalPadding(); return nsMargin(0,0,0,0); } /* virtual */ nsMargin -nsTableFrame::GetUsedMargin() const +nsTableFrame::GetUsedPhysicalMargin() const { // The margin is inherited to the outer table frame via // the ::-moz-table-outer rule in ua.css. return nsMargin(0, 0, 0, 0); } // Destructor function for BCPropertyData properties static void @@ -2708,17 +2708,17 @@ nsTableFrame::PlaceRepeatedFooter(nsTabl nsHTMLReflowState footerReflowState(presContext, aReflowState.reflowState, aTfoot, kidAvailSize, -1, -1, nsHTMLReflowState::CALLER_WILL_INIT); InitChildReflowState(footerReflowState); aReflowState.y += GetCellSpacingY(); - nsRect origTfootRect = aTfoot->GetRect(); + nsRect origTfootRect = aTfoot->GetPhysicalRect(); nsRect origTfootVisualOverflow = aTfoot->GetVisualOverflowRect(); nsReflowStatus footerStatus; nsHTMLReflowMetrics desiredSize; desiredSize.width = desiredSize.height = 0; ReflowChild(aTfoot, presContext, desiredSize, footerReflowState, aReflowState.x, aReflowState.y, 0, footerStatus); PlaceChild(aReflowState, aTfoot, desiredSize, origTfootRect, @@ -2815,17 +2815,17 @@ nsTableFrame::ReflowChildren(nsTableRefl NS_ASSERTION(tfoot == rowGroups[rowGroups.Length() - 1], "Missing footer!"); if (footerHeight + cellSpacingY < kidAvailSize.height) { allowRepeatedFooter = true; kidAvailSize.height -= footerHeight + cellSpacingY; } } } - nsRect oldKidRect = kidFrame->GetRect(); + nsRect oldKidRect = kidFrame->GetPhysicalRect(); nsRect oldKidVisualOverflow = kidFrame->GetVisualOverflowRect(); nsHTMLReflowMetrics desiredSize; desiredSize.width = desiredSize.height = 0; // Reflow the child into the available space nsHTMLReflowState kidReflowState(presContext, aReflowState.reflowState, kidFrame, kidAvailSize, @@ -2833,17 +2833,17 @@ nsTableFrame::ReflowChildren(nsTableRefl nsHTMLReflowState::CALLER_WILL_INIT); InitChildReflowState(kidReflowState); // If this isn't the first row group, and the previous row group has a // nonzero YMost, then we can't be at the top of the page. // We ignore a repeated head row group in this check to avoid causing // infinite loops in some circumstances - see bug 344883. if (childX > ((thead && IsRepeatedFrame(thead)) ? 1u : 0u) && - (rowGroups[childX - 1]->GetRect().YMost() > 0)) { + (rowGroups[childX - 1]->GetPhysicalRect().YMost() > 0)) { kidReflowState.mFlags.mIsTopOfPage = false; } aReflowState.y += cellSpacingY; if (NS_UNCONSTRAINEDSIZE != aReflowState.availSize.height) { aReflowState.availSize.height -= cellSpacingY; } // record the presence of a next in flow, it might get destroyed so we // need to reorder the row group array @@ -2972,17 +2972,17 @@ nsTableFrame::ReflowChildren(nsTableRefl if (nextSibling) { PushChildren(rowGroups, childX + 1); } break; } } else { // it isn't being reflowed aReflowState.y += cellSpacingY; - nsRect kidRect = kidFrame->GetRect(); + nsRect kidRect = kidFrame->GetPhysicalRect(); if (kidRect.y != aReflowState.y) { // invalidate the old position kidFrame->InvalidateFrameSubtree(); kidRect.y = aReflowState.y; kidFrame->SetRect(kidRect); // move to the new position RePositionViews(kidFrame); // invalidate the new position kidFrame->InvalidateFrameSubtree(); @@ -3056,17 +3056,17 @@ nsTableFrame::CalcDesiredHeight(const ns return; } int32_t rowCount = cellMap->GetRowCount(); int32_t colCount = cellMap->GetColCount(); nscoord desiredHeight = borderPadding.top + borderPadding.bottom; if (rowCount > 0 && colCount > 0) { desiredHeight += cellSpacingY; for (uint32_t rgX = 0; rgX < rowGroups.Length(); rgX++) { - desiredHeight += rowGroups[rgX]->GetSize().height + cellSpacingY; + desiredHeight += rowGroups[rgX]->GetPhysicalSize().height + cellSpacingY; } } // see if a specified table height requires dividing additional space to rows if (!GetPrevInFlow()) { nscoord tableSpecifiedHeight = CalcBorderBoxHeight(aReflowState); if ((tableSpecifiedHeight > 0) && (tableSpecifiedHeight != NS_UNCONSTRAINEDSIZE) && @@ -3085,39 +3085,39 @@ nsTableFrame::CalcDesiredHeight(const ns } static void ResizeCells(nsTableFrame& aTableFrame) { nsTableFrame::RowGroupArray rowGroups; aTableFrame.OrderRowGroups(rowGroups); nsHTMLReflowMetrics tableDesiredSize; - nsRect tableRect = aTableFrame.GetRect(); + nsRect tableRect = aTableFrame.GetPhysicalRect(); tableDesiredSize.width = tableRect.width; tableDesiredSize.height = tableRect.height; tableDesiredSize.SetOverflowAreasToDesiredBounds(); for (uint32_t rgX = 0; rgX < rowGroups.Length(); rgX++) { nsTableRowGroupFrame* rgFrame = rowGroups[rgX]; - nsRect rowGroupRect = rgFrame->GetRect(); + nsRect rowGroupRect = rgFrame->GetPhysicalRect(); nsHTMLReflowMetrics groupDesiredSize; groupDesiredSize.width = rowGroupRect.width; groupDesiredSize.height = rowGroupRect.height; groupDesiredSize.SetOverflowAreasToDesiredBounds(); nsTableRowFrame* rowFrame = rgFrame->GetFirstRow(); while (rowFrame) { rowFrame->DidResize(); rgFrame->ConsiderChildOverflow(groupDesiredSize.mOverflowAreas, rowFrame); rowFrame = rowFrame->GetNextRow(); } rgFrame->FinishAndStoreOverflow(&groupDesiredSize); tableDesiredSize.mOverflowAreas.UnionWith(groupDesiredSize.mOverflowAreas + - rgFrame->GetPosition()); + rgFrame->GetPhysicalPosition()); } aTableFrame.FinishAndStoreOverflow(&tableDesiredSize); } void nsTableFrame::DistributeHeightToRows(const nsHTMLReflowState& aReflowState, nscoord aAmount) { @@ -3135,21 +3135,21 @@ nsTableFrame::DistributeHeightToRows(con nscoord pctBasis = aReflowState.ComputedHeight() - (GetCellSpacingY() * (GetRowCount() + 1)); nscoord yOriginRG = borderPadding.top + GetCellSpacingY(); nscoord yEndRG = yOriginRG; uint32_t rgX; for (rgX = 0; rgX < rowGroups.Length(); rgX++) { nsTableRowGroupFrame* rgFrame = rowGroups[rgX]; nscoord amountUsedByRG = 0; nscoord yOriginRow = 0; - nsRect rgRect = rgFrame->GetRect(); + nsRect rgRect = rgFrame->GetPhysicalRect(); if (!rgFrame->HasStyleHeight()) { nsTableRowFrame* rowFrame = rgFrame->GetFirstRow(); while (rowFrame) { - nsRect rowRect = rowFrame->GetRect(); + nsRect rowRect = rowFrame->GetPhysicalRect(); if ((amountUsed < aAmount) && rowFrame->HasPctHeight()) { nscoord pctHeight = rowFrame->GetHeight(pctBasis); nscoord amountForRow = std::min(aAmount - amountUsed, pctHeight - rowRect.height); if (amountForRow > 0) { nsRect oldRowRect = rowRect; rowRect.height += amountForRow; // XXXbz we don't need to change rowRect.y to be yOriginRow? rowFrame->SetRect(rowRect); @@ -3243,19 +3243,19 @@ nsTableFrame::DistributeHeightToRows(con } else { for (rgX = 0; rgX < rowGroups.Length(); rgX++) { nsTableRowGroupFrame* rgFrame = rowGroups[rgX]; if (!firstUnStyledRG || !rgFrame->HasStyleHeight()) { nsTableRowFrame* rowFrame = rgFrame->GetFirstRow(); while (rowFrame) { if (!firstUnStyledRG || !rowFrame->HasStyleHeight()) { - NS_ASSERTION(rowFrame->GetSize().height >= 0, + NS_ASSERTION(rowFrame->GetPhysicalSize().height >= 0, "negative row frame height"); - divisor += rowFrame->GetSize().height; + divisor += rowFrame->GetPhysicalSize().height; eligibleRows++; lastEligibleRow = rowFrame; } rowFrame = rowFrame->GetNextRow(); } } } if (divisor <= 0) { @@ -3271,23 +3271,23 @@ nsTableFrame::DistributeHeightToRows(con // allocate the extra height to the unstyled row groups and rows nscoord heightToDistribute = aAmount - amountUsed; yOriginRG = borderPadding.top + cellSpacingY; yEndRG = yOriginRG; for (rgX = 0; rgX < rowGroups.Length(); rgX++) { nsTableRowGroupFrame* rgFrame = rowGroups[rgX]; nscoord amountUsedByRG = 0; nscoord yOriginRow = 0; - nsRect rgRect = rgFrame->GetRect(); + nsRect rgRect = rgFrame->GetPhysicalRect(); nsRect rgVisualOverflow = rgFrame->GetVisualOverflowRect(); // see if there is an eligible row group or we distribute to all rows if (!firstUnStyledRG || !rgFrame->HasStyleHeight() || !eligibleRows) { nsTableRowFrame* rowFrame = rgFrame->GetFirstRow(); while (rowFrame) { - nsRect rowRect = rowFrame->GetRect(); + nsRect rowRect = rowFrame->GetPhysicalRect(); nsRect rowVisualOverflow = rowFrame->GetVisualOverflowRect(); // see if there is an eligible row or we distribute to all rows if (!firstUnStyledRow || !rowFrame->HasStyleHeight() || !eligibleRows) { float ratio; if (eligibleRows) { if (!expandEmptyRows) { // The amount of additional space each row gets is proportional to // its height @@ -3401,22 +3401,22 @@ nsTableFrame::GetBaseline() const nscoord ascent = 0; RowGroupArray orderedRowGroups; OrderRowGroups(orderedRowGroups); nsTableRowFrame* firstRow = nullptr; for (uint32_t rgIndex = 0; rgIndex < orderedRowGroups.Length(); rgIndex++) { nsTableRowGroupFrame* rgFrame = orderedRowGroups[rgIndex]; if (rgFrame->GetRowCount()) { firstRow = rgFrame->GetFirstRow(); - ascent = rgFrame->GetRect().y + firstRow->GetRect().y + firstRow->GetRowBaseline(); + ascent = rgFrame->GetPhysicalRect().y + firstRow->GetPhysicalRect().y + firstRow->GetRowBaseline(); break; } } if (!firstRow) - ascent = GetRect().height; + ascent = GetPhysicalRect().height; return ascent; } /* ----- global methods ----- */ nsIFrame* NS_NewTableFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) { return new (aPresShell) nsTableFrame(aContext); @@ -6166,17 +6166,17 @@ BCPaintBorderIterator::SetDamageArea(con for (nsTableRowFrame* rowFrame = rgFrame->GetFirstRow(); rowFrame; rowFrame = rowFrame->GetNextRow()) { // conservatively estimate the half border widths outside the row nscoord topBorderHalf = (mTable->GetPrevInFlow()) ? 0 : nsPresContext::CSSPixelsToAppUnits(rowFrame->GetTopBCBorderWidth() + 1); nscoord bottomBorderHalf = (mTable->GetNextInFlow()) ? 0 : nsPresContext::CSSPixelsToAppUnits(rowFrame->GetBottomBCBorderWidth() + 1); // get the row rect relative to the table rather than the row group - nsSize rowSize = rowFrame->GetSize(); + nsSize rowSize = rowFrame->GetPhysicalSize(); if (haveIntersect) { if (aDirtyRect.YMost() >= (rowY - topBorderHalf)) { nsTableRowFrame* fifRow = static_cast(rowFrame->GetFirstInFlow()); endRowIndex = fifRow->GetRowIndex(); } else done = true; } @@ -6214,27 +6214,27 @@ BCPaintBorderIterator::SetDamageArea(con nsMargin childAreaOffset = mTable->GetChildAreaOffset(nullptr); if (mTableIsLTR) { mInitialOffsetX = childAreaOffset.left; // x position of first col in // damage area leftCol = 0; rightCol = mNumTableCols; } else { // x position of first col in damage area - mInitialOffsetX = mTable->GetRect().width - childAreaOffset.right; + mInitialOffsetX = mTable->GetPhysicalRect().width - childAreaOffset.right; leftCol = mNumTableCols-1; rightCol = -1; } nscoord x = 0; int32_t colX; for (colX = leftCol; colX != rightCol; colX += mColInc) { nsTableColFrame* colFrame = mTableFirstInFlow->GetColFrame(colX); if (!colFrame) ABORT1(false); // get the col rect relative to the table rather than the col group - nsSize size = colFrame->GetSize(); + nsSize size = colFrame->GetPhysicalSize(); if (haveIntersect) { // conservatively estimate the left half border width outside the col nscoord leftBorderHalf = nsPresContext::CSSPixelsToAppUnits(colFrame->GetLeftBorderWidth() + 1); if (aDirtyRect.XMost() >= (x - leftBorderHalf)) { endColIndex = colX; } else break; @@ -6250,22 +6250,22 @@ BCPaintBorderIterator::SetDamageArea(con else { mInitialOffsetX += mColInc * size.width; } } x += size.width; } if (!mTableIsLTR) { uint32_t temp; - mInitialOffsetX = mTable->GetRect().width - childAreaOffset.right; + mInitialOffsetX = mTable->GetPhysicalRect().width - childAreaOffset.right; temp = startColIndex; startColIndex = endColIndex; endColIndex = temp; for (uint32_t column = 0; column < startColIndex; column++) { nsTableColFrame* colFrame = mTableFirstInFlow->GetColFrame(column); if (!colFrame) ABORT1(false); - nsSize size = colFrame->GetSize(); + nsSize size = colFrame->GetPhysicalSize(); mInitialOffsetX += mColInc * size.width; } } if (!haveIntersect) return false; mDamageArea = nsIntRect(startColIndex, startRowIndex, 1 + DeprecatedAbs(endColIndex - startColIndex), 1 + endRowIndex - startRowIndex); @@ -6640,17 +6640,17 @@ BCVerticalSeg::Initialize(BCPaintBorderI aIter.mTableFirstInFlow->GetColFrame(aIter.mColIndex); if (!mCol) ABORT0(); if (0 == relColIndex) { mOffsetX = aIter.mInitialOffsetX; } // set colX for the next column if (!aIter.IsDamageAreaRightMost()) { aIter.mVerInfo[relColIndex + 1].mOffsetX = mOffsetX + - aIter.mColInc * mCol->GetSize().width; + aIter.mColInc * mCol->GetPhysicalSize().width; } mOffsetY = aIter.mInitialOffsetY; mLastCell = aIter.mCell; } /** * Compute the offsets for the bottom corner of a vertical segment * @param aIter - iterator containing the structural information @@ -6773,17 +6773,17 @@ BCVerticalSeg::AdvanceOffsetY() /** * Accumulate the current segment */ void BCVerticalSeg::IncludeCurrentBorder(BCPaintBorderIterator& aIter) { mLastCell = aIter.mCell; - mLength += aIter.mRow->GetRect().height; + mLength += aIter.mRow->GetPhysicalRect().height; } BCHorizontalSeg::BCHorizontalSeg() { mOffsetX = mOffsetY = mLength = mWidth = mLeftBevelOffset = 0; mLeftBevelSide = NS_SIDE_TOP; mFirstCell = mAjaCell = nullptr; } @@ -6980,17 +6980,17 @@ void BCPaintBorderIterator::StoreColumnWidth(int32_t aIndex) { if (IsTableRightMost()) { mVerInfo[aIndex].mColWidth = mVerInfo[aIndex - 1].mColWidth; } else { nsTableColFrame* col = mTableFirstInFlow->GetColFrame(mColIndex); if (!col) ABORT0(); - mVerInfo[aIndex].mColWidth = col->GetSize().width; + mVerInfo[aIndex].mColWidth = col->GetPhysicalSize().width; } } /** * Determine if a vertical segment owns the corder */ bool BCPaintBorderIterator::VerticalSegmentOwnsCorner() { @@ -7026,17 +7026,17 @@ BCPaintBorderIterator::AccumulateOrPaint nscoord leftSegWidth = mBCData ? mBCData->GetLeftEdge(ignoreBorderOwner, ignoreSegStart) : 0; nscoord topSegHeight = mBCData ? mBCData->GetTopEdge(borderOwner, isSegStart) : 0; if (mIsNewRow || (IsDamageAreaLeftMost() && IsDamageAreaBottomMost())) { // reset for every new row and on the bottom of the last row mHorSeg.mOffsetY = mNextOffsetY; - mNextOffsetY = mNextOffsetY + mRow->GetSize().height; + mNextOffsetY = mNextOffsetY + mRow->GetPhysicalSize().height; mHorSeg.mOffsetX = mInitialOffsetX; mHorSeg.Start(*this, borderOwner, leftSegWidth, topSegHeight); } if (!IsDamageAreaLeftMost() && (isSegStart || IsDamageAreaRightMost() || VerticalSegmentOwnsCorner())) { // paint the previous seg or the current one if IsDamageAreaRightMost() if (mHorSeg.mLength > 0) { @@ -7188,26 +7188,26 @@ nsTableFrame::InvalidateTableFrame(nsIFr // The part that looks at both the rect and the overflow rect is a // bit of a hack. See nsBlockFrame::ReflowLine for an eloquent // description of its hackishness. // // This doesn't really make sense now that we have DLBI. // This code can probably be simplified a fair bit. nsRect visualOverflow = aFrame->GetVisualOverflowRect(); if (aIsFirstReflow || - aOrigRect.TopLeft() != aFrame->GetPosition() || + aOrigRect.TopLeft() != aFrame->GetPhysicalPosition() || aOrigVisualOverflow.TopLeft() != visualOverflow.TopLeft()) { // Invalidate the old and new overflow rects. Note that if the // frame moved, we can't just use aOrigVisualOverflow, since it's in // coordinates relative to the old position. So invalidate via // aFrame's parent, and reposition that overflow rect to the right // place. // XXXbz this doesn't handle outlines, does it? aFrame->InvalidateFrame(); parent->InvalidateFrameWithRect(aOrigVisualOverflow + aOrigRect.TopLeft()); - } else if (aOrigRect.Size() != aFrame->GetSize() || + } else if (aOrigRect.Size() != aFrame->GetPhysicalSize() || aOrigVisualOverflow.Size() != visualOverflow.Size()){ aFrame->InvalidateFrameWithRect(aOrigVisualOverflow); aFrame->InvalidateFrame(); parent->InvalidateFrameWithRect(aOrigRect);; parent->InvalidateFrame(); } } diff --git a/layout/tables/nsTableFrame.h b/layout/tables/nsTableFrame.h --- a/layout/tables/nsTableFrame.h +++ b/layout/tables/nsTableFrame.h @@ -164,19 +164,19 @@ public: NS_IMETHOD AppendFrames(ChildListID aListID, nsFrameList& aFrameList) MOZ_OVERRIDE; NS_IMETHOD InsertFrames(ChildListID aListID, nsIFrame* aPrevFrame, nsFrameList& aFrameList) MOZ_OVERRIDE; NS_IMETHOD RemoveFrame(ChildListID aListID, nsIFrame* aOldFrame) MOZ_OVERRIDE; - virtual nsMargin GetUsedBorder() const MOZ_OVERRIDE; - virtual nsMargin GetUsedPadding() const MOZ_OVERRIDE; - virtual nsMargin GetUsedMargin() const MOZ_OVERRIDE; + virtual nsMargin GetUsedPhysicalBorder() const MOZ_OVERRIDE; + virtual nsMargin GetUsedPhysicalPadding() const MOZ_OVERRIDE; + virtual nsMargin GetUsedPhysicalMargin() const MOZ_OVERRIDE; // Get the offset from the border box to the area where the row groups fit nsMargin GetChildAreaOffset(const nsHTMLReflowState* aReflowState) const; /** helper method to find the table parent of any table frame object */ static nsTableFrame* GetTableFrame(nsIFrame* aSourceFrame); typedef void (* DisplayGenericTablePartTraversal) diff --git a/layout/tables/nsTableOuterFrame.cpp b/layout/tables/nsTableOuterFrame.cpp --- a/layout/tables/nsTableOuterFrame.cpp +++ b/layout/tables/nsTableOuterFrame.cpp @@ -50,17 +50,17 @@ nsTableCaptionFrame::GetType() const nsTableOuterFrame::GetBaseline() const { nsIFrame* kid = mFrames.FirstChild(); if (!kid) { NS_NOTREACHED("no inner table"); return nsContainerFrame::GetBaseline(); } - return kid->GetBaseline() + kid->GetPosition().y; + return kid->GetBaseline() + kid->GetPhysicalPosition().y; } /* virtual */ nsSize nsTableCaptionFrame::ComputeAutoSize(nsRenderingContext *aRenderingContext, nsSize aCBSize, nscoord aAvailableWidth, nsSize aMargin, nsSize aBorder, nsSize aPadding, bool aShrinkWrap) { @@ -111,17 +111,17 @@ nsTableCaptionFrame::GetParentStyleConte NS_NOTREACHED("Where is our inner table frame?"); return nsBlockFrame::GetParentStyleContextFrame(); } #ifdef ACCESSIBILITY a11y::AccType nsTableCaptionFrame::AccessibleType() { - if (!GetRect().IsEmpty()) { + if (!GetPhysicalRect().IsEmpty()) { return a11y::eHTMLCaptionType; } return a11y::eNoType; } #endif #ifdef DEBUG @@ -587,23 +587,23 @@ void nsTableOuterFrame::SetDesiredSize(uint8_t aCaptionSide, const nsMargin& aInnerMargin, const nsMargin& aCaptionMargin, nscoord& aWidth, nscoord& aHeight) { aWidth = aHeight = 0; - nsRect innerRect = InnerTableFrame()->GetRect(); + nsRect innerRect = InnerTableFrame()->GetPhysicalRect(); nscoord innerWidth = innerRect.width; nsRect captionRect(0,0,0,0); nscoord captionWidth = 0; if (mCaptionFrames.NotEmpty()) { - captionRect = mCaptionFrames.FirstChild()->GetRect(); + captionRect = mCaptionFrames.FirstChild()->GetPhysicalRect(); captionWidth = captionRect.width; } switch(aCaptionSide) { case NS_STYLE_CAPTION_SIDE_LEFT: aWidth = std::max(aInnerMargin.left, aCaptionMargin.left + captionWidth + aCaptionMargin.right) + innerWidth + aInnerMargin.right; break; case NS_STYLE_CAPTION_SIDE_RIGHT: @@ -842,17 +842,17 @@ nsresult nsTableOuterFrame::OuterDoReflowChild(nsPresContext* aPresContext, nsIFrame* aChildFrame, const nsHTMLReflowState& aChildRS, nsHTMLReflowMetrics& aMetrics, nsReflowStatus& aStatus) { // use the current position as a best guess for placement - nsPoint childPt = aChildFrame->GetPosition(); + nsPoint childPt = aChildFrame->GetPhysicalPosition(); uint32_t flags = NS_FRAME_NO_MOVE_FRAME; // We don't want to delete our next-in-flow's child if it's an inner table // frame, because outer table frames always assume that their inner table // frames don't go away. If an outer table frame is removed because it is // a next-in-flow of an already complete outer table frame, then it will // take care of removing it's inner table frame. if (aChildFrame == InnerTableFrame()) { @@ -905,25 +905,25 @@ NS_METHOD nsTableOuterFrame::Reflow(nsPr ((sizeof(nsHTMLReflowState) + sizeof(long) - 1) / sizeof(long)) long captionRSSpace[LONGS_IN_HTMLRS]; nsHTMLReflowState *captionRS = static_cast((void*)captionRSSpace); long innerRSSpace[LONGS_IN_HTMLRS]; nsHTMLReflowState *innerRS = static_cast((void*) innerRSSpace); - nsRect origInnerRect = InnerTableFrame()->GetRect(); + nsRect origInnerRect = InnerTableFrame()->GetPhysicalRect(); nsRect origInnerVisualOverflow = InnerTableFrame()->GetVisualOverflowRect(); bool innerFirstReflow = (InnerTableFrame()->GetStateBits() & NS_FRAME_FIRST_REFLOW) != 0; nsRect origCaptionRect; nsRect origCaptionVisualOverflow; bool captionFirstReflow; if (mCaptionFrames.NotEmpty()) { - origCaptionRect = mCaptionFrames.FirstChild()->GetRect(); + origCaptionRect = mCaptionFrames.FirstChild()->GetPhysicalRect(); origCaptionVisualOverflow = mCaptionFrames.FirstChild()->GetVisualOverflowRect(); captionFirstReflow = (mCaptionFrames.FirstChild()->GetStateBits() & NS_FRAME_FIRST_REFLOW) != 0; } // ComputeAutoSize has to match this logic. if (captionSide == NO_SIDE) { diff --git a/layout/tables/nsTablePainter.cpp b/layout/tables/nsTablePainter.cpp --- a/layout/tables/nsTablePainter.cpp +++ b/layout/tables/nsTablePainter.cpp @@ -135,17 +135,17 @@ TableBackgroundPainter::TableBackgroundD mVisible = false; } void TableBackgroundPainter::TableBackgroundData::SetFrame(nsIFrame* aFrame) { NS_PRECONDITION(aFrame, "null frame"); mFrame = aFrame; - mRect = aFrame->GetRect(); + mRect = aFrame->GetPhysicalRect(); } void TableBackgroundPainter::TableBackgroundData::SetData() { NS_PRECONDITION(mFrame, "null frame"); if (mFrame->IsVisibleForPainting()) { mVisible = true; @@ -560,17 +560,17 @@ TableBackgroundPainter::PaintRow(nsTable if (eOrigin_TableRow == mOrigin) { /* If we originate from the row, then make the row the origin. */ mRow.mRect.MoveTo(0, 0); } //else: Use row group's coord system -> no translation necessary for (nsTableCellFrame* cell = aFrame->GetFirstCell(); cell; cell = cell->GetNextCell()) { //Translate to use the same coord system as mRow. - mCellRect = cell->GetRect() + mRow.mRect.TopLeft() + mRenderPt; + mCellRect = cell->GetPhysicalRect() + mRow.mRect.TopLeft() + mRenderPt; if (mCellRect.Intersects(mDirtyRect)) { nsresult rv = PaintCell(cell, aPassThrough || cell->IsPseudoStackingContextFromStyle()); if (NS_FAILED(rv)) return rv; } } /* Unload row data */ mRow.Clear(); diff --git a/layout/tables/nsTableRowFrame.cpp b/layout/tables/nsTableRowFrame.cpp --- a/layout/tables/nsTableRowFrame.cpp +++ b/layout/tables/nsTableRowFrame.cpp @@ -250,45 +250,45 @@ nsTableRowFrame::RemoveFrame(ChildListID NS_ERROR("unexpected frame type"); return NS_ERROR_INVALID_ARG; } return NS_OK; } /* virtual */ nsMargin -nsTableRowFrame::GetUsedMargin() const +nsTableRowFrame::GetUsedPhysicalMargin() const { return nsMargin(0,0,0,0); } /* virtual */ nsMargin -nsTableRowFrame::GetUsedBorder() const +nsTableRowFrame::GetUsedPhysicalBorder() const { return nsMargin(0,0,0,0); } /* virtual */ nsMargin -nsTableRowFrame::GetUsedPadding() const +nsTableRowFrame::GetUsedPhysicalPadding() const { return nsMargin(0,0,0,0); } nscoord GetHeightOfRowsSpannedBelowFirst(nsTableCellFrame& aTableCellFrame, nsTableFrame& aTableFrame) { nscoord height = 0; nscoord cellSpacingY = aTableFrame.GetCellSpacingY(); int32_t rowSpan = aTableFrame.GetEffectiveRowSpan(aTableCellFrame); // add in height of rows spanned beyond the 1st one nsIFrame* nextRow = aTableCellFrame.GetParent()->GetNextSibling(); for (int32_t rowX = 1; ((rowX < rowSpan) && nextRow);) { if (nsGkAtoms::tableRowFrame == nextRow->GetType()) { - height += nextRow->GetSize().height; + height += nextRow->GetPhysicalSize().height; rowX++; } height += cellSpacingY; nextRow = nextRow->GetNextSibling(); } return height; } @@ -323,17 +323,17 @@ nsTableRowFrame::DidResize() desiredSize.SetOverflowAreasToDesiredBounds(); while (childFrame) { nsTableCellFrame *cellFrame = do_QueryFrame(childFrame); if (cellFrame) { nscoord cellHeight = mRect.height + GetHeightOfRowsSpannedBelowFirst(*cellFrame, *tableFrame); // resize the cell's height - nsRect cellRect = cellFrame->GetRect(); + nsRect cellRect = cellFrame->GetPhysicalRect(); nsRect cellVisualOverflow = cellFrame->GetVisualOverflowRect(); if (cellRect.height != cellHeight) { cellFrame->SetSize(nsSize(cellRect.width, cellHeight)); nsTableFrame::InvalidateTableFrame(cellFrame, cellRect, cellVisualOverflow, false); } @@ -392,17 +392,17 @@ nscoord nsTableRowFrame::GetRowBaseline( // bbbbbbbbbbbbbbbbbb nsTableIterator iter(*this); nsIFrame* childFrame = iter.First(); nscoord ascent = 0; while (childFrame) { if (IS_TABLE_CELL(childFrame->GetType())) { nsIFrame* firstKid = childFrame->GetFirstPrincipalChild(); - ascent = std::max(ascent, firstKid->GetRect().YMost()); + ascent = std::max(ascent, firstKid->GetPhysicalRect().YMost()); } // Get the next child childFrame = iter.Next(); } return ascent; } nscoord nsTableRowFrame::GetHeight(nscoord aPctBasis) const @@ -632,20 +632,20 @@ nsTableRowFrame::CalculateCellActualHeig // In quirks mode, table cell width should be content-box, but height // should be border-box. // Because of this historic anomaly, we do not use quirk.css // (since we can't specify one value of box-sizing for width and another // for height) if (PresContext()->CompatibilityMode() != eCompatibility_NavQuirks) { switch (position->mBoxSizing) { case NS_STYLE_BOX_SIZING_CONTENT: - outsideBoxSizing = aCellFrame->GetUsedBorderAndPadding().TopBottom(); + outsideBoxSizing = aCellFrame->GetUsedPhysicalBorderAndPadding().TopBottom(); break; case NS_STYLE_BOX_SIZING_PADDING: - outsideBoxSizing = aCellFrame->GetUsedBorder().TopBottom(); + outsideBoxSizing = aCellFrame->GetUsedPhysicalBorder().TopBottom(); break; default: // NS_STYLE_BOX_SIZING_BORDER break; } } specifiedHeight = @@ -765,17 +765,17 @@ nscoord CalcHeightFromUnpaginatedHeight( { nscoord height = 0; nsTableRowFrame* firstInFlow = static_cast(aRow.GetFirstInFlow()); if (firstInFlow->HasUnpaginatedHeight()) { height = firstInFlow->GetUnpaginatedHeight(aPresContext); for (nsIFrame* prevInFlow = aRow.GetPrevInFlow(); prevInFlow; prevInFlow = prevInFlow->GetPrevInFlow()) { - height -= prevInFlow->GetSize().height; + height -= prevInFlow->GetPhysicalSize().height; } } return std::max(height, 0); } nsresult nsTableRowFrame::ReflowChildren(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, @@ -853,17 +853,17 @@ nsTableRowFrame::ReflowChildren(nsPresCo x += GetSpaceBetween(prevColIndex, cellColIndex, cellColSpan, aTableFrame, cellSpacingX, iter.IsLeftToRight(), false); } // remember the rightmost (ltr) or leftmost (rtl) column this cell spans into prevColIndex = (iter.IsLeftToRight()) ? cellColIndex + (cellColSpan - 1) : cellColIndex; // Reflow the child frame - nsRect kidRect = kidFrame->GetRect(); + nsRect kidRect = kidFrame->GetPhysicalRect(); nsRect kidVisualOverflow = kidFrame->GetVisualOverflowRect(); bool firstReflow = (kidFrame->GetStateBits() & NS_FRAME_FIRST_REFLOW) != 0; if (doReflowChild) { // Calculate the available width for the table cell using the known column widths nscoord availCellWidth = CalcAvailWidth(aTableFrame, *cellFrame, cellSpacingX); @@ -1073,17 +1073,17 @@ nscoord nsTableRowFrame::ReflowCellFrame(nsPresContext* aPresContext, const nsHTMLReflowState& aReflowState, bool aIsTopOfPage, nsTableCellFrame* aCellFrame, nscoord aAvailableHeight, nsReflowStatus& aStatus) { // Reflow the cell frame with the specified height. Use the existing width - nsRect cellRect = aCellFrame->GetRect(); + nsRect cellRect = aCellFrame->GetPhysicalRect(); nsRect cellVisualOverflow = aCellFrame->GetVisualOverflowRect(); nsSize availSize(cellRect.width, aAvailableHeight); nsTableFrame* tableFrame = nsTableFrame::GetTableFrame(this); bool borderCollapse = tableFrame->IsBorderCollapse(); nsTableCellReflowState cellReflowState(aPresContext, aReflowState, aCellFrame, availSize, nsHTMLReflowState::CALLER_WILL_INIT); @@ -1131,33 +1131,33 @@ nsTableRowFrame::CollapseRowIfNecessary( tableFrame->SetNeedToCollapse(true); } if (aRowOffset != 0) { // We're moving, so invalidate our old position InvalidateFrameSubtree(); } - nsRect rowRect = GetRect(); + nsRect rowRect = GetPhysicalRect(); nsRect oldRect = rowRect; nsRect oldVisualOverflow = GetVisualOverflowRect(); rowRect.y -= aRowOffset; rowRect.width = aWidth; nsOverflowAreas overflow; nscoord shift = 0; nscoord cellSpacingX = tableFrame->GetCellSpacingX(); nscoord cellSpacingY = tableFrame->GetCellSpacingY(); if (aCollapseGroup || collapseRow) { nsTableCellFrame* cellFrame = GetFirstCell(); aDidCollapse = true; shift = rowRect.height + cellSpacingY; while (cellFrame) { - nsRect cRect = cellFrame->GetRect(); + nsRect cRect = cellFrame->GetPhysicalRect(); // If aRowOffset != 0, there's no point in invalidating the cells, since // we've already invalidated our overflow area. Note that we _do_ still // need to invalidate if our row is not moving, because the cell might // span out of this row, so invalidating our row rect won't do enough. if (aRowOffset == 0) { InvalidateFrame(); } cRect.height = 0; @@ -1238,23 +1238,23 @@ nsTableRowFrame::CollapseRowIfNecessary( x += cellSpacingX; int32_t actualRowSpan = tableFrame->GetEffectiveRowSpan(*cellFrame); nsTableRowFrame* rowFrame = GetNextRow(); for (actualRowSpan--; actualRowSpan > 0 && rowFrame; actualRowSpan--) { const nsStyleVisibility* nextRowVis = rowFrame->StyleVisibility(); bool collapseNextRow = (NS_STYLE_VISIBILITY_COLLAPSE == nextRowVis->mVisible); if (!collapseNextRow) { - nsRect nextRect = rowFrame->GetRect(); + nsRect nextRect = rowFrame->GetPhysicalRect(); cRect.height += nextRect.height + cellSpacingY; } rowFrame = rowFrame->GetNextRow(); } - nsRect oldCellRect = cellFrame->GetRect(); + nsRect oldCellRect = cellFrame->GetPhysicalRect(); nsRect oldCellVisualOverflow = cellFrame->GetVisualOverflowRect(); if (aRowOffset == 0 && cRect.TopLeft() != oldCellRect.TopLeft()) { // We're moving the cell. Invalidate the old overflow area cellFrame->InvalidateFrameSubtree(); } cellFrame->SetRect(cRect); @@ -1403,27 +1403,27 @@ void nsTableRowFrame::InitHasCellWithSty } RemoveStateBits(NS_ROW_HAS_CELL_WITH_STYLE_HEIGHT); } void nsTableRowFrame::InvalidateFrame(uint32_t aDisplayItemKey) { nsIFrame::InvalidateFrame(aDisplayItemKey); - GetParent()->InvalidateFrameWithRect(GetVisualOverflowRect() + GetPosition(), aDisplayItemKey); + GetParent()->InvalidateFrameWithRect(GetVisualOverflowRect() + GetPhysicalPosition(), aDisplayItemKey); } void nsTableRowFrame::InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey) { nsIFrame::InvalidateFrameWithRect(aRect, aDisplayItemKey); // If we have filters applied that would affects our bounds, then // we get an inactive layer created and this is computed // within FrameLayerBuilder - GetParent()->InvalidateFrameWithRect(aRect + GetPosition(), aDisplayItemKey); + GetParent()->InvalidateFrameWithRect(aRect + GetPhysicalPosition(), aDisplayItemKey); } /* ----- global methods ----- */ nsIFrame* NS_NewTableRowFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) { return new (aPresShell) nsTableRowFrame(aContext); diff --git a/layout/tables/nsTableRowFrame.h b/layout/tables/nsTableRowFrame.h --- a/layout/tables/nsTableRowFrame.h +++ b/layout/tables/nsTableRowFrame.h @@ -58,19 +58,19 @@ public: /** instantiate a new instance of nsTableRowFrame. * @param aPresShell the pres shell for this frame * * @return the frame that was created */ friend nsIFrame* NS_NewTableRowFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); - virtual nsMargin GetUsedMargin() const MOZ_OVERRIDE; - virtual nsMargin GetUsedBorder() const MOZ_OVERRIDE; - virtual nsMargin GetUsedPadding() const MOZ_OVERRIDE; + virtual nsMargin GetUsedPhysicalMargin() const MOZ_OVERRIDE; + virtual nsMargin GetUsedPhysicalBorder() const MOZ_OVERRIDE; + virtual nsMargin GetUsedPhysicalPadding() const MOZ_OVERRIDE; virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder, const nsRect& aDirtyRect, const nsDisplayListSet& aLists) MOZ_OVERRIDE; nsTableCellFrame* GetFirstCell() ; /** calls Reflow for all of its child cells. diff --git a/layout/tables/nsTableRowGroupFrame.cpp b/layout/tables/nsTableRowGroupFrame.cpp --- a/layout/tables/nsTableRowGroupFrame.cpp +++ b/layout/tables/nsTableRowGroupFrame.cpp @@ -190,17 +190,17 @@ DisplayRows(nsDisplayListBuilder* aBuild // approximate it by checking it for |f|: if it's true for any row // in |f| then it's true for |f| itself. nsIFrame* kid = aBuilder->ShouldDescendIntoFrame(f) ? nullptr : f->GetFirstRowContaining(aDirtyRect.y, &overflowAbove); if (kid) { // have a cursor, use it while (kid) { - if (kid->GetRect().y - overflowAbove >= aDirtyRect.YMost()) + if (kid->GetPhysicalRect().y - overflowAbove >= aDirtyRect.YMost()) break; f->BuildDisplayListForChild(aBuilder, kid, aDirtyRect, aLists); kid = kid->GetNextSibling(); } return; } // No cursor. Traverse children the hard way and build a cursor while we're at it @@ -304,17 +304,17 @@ nsTableRowGroupFrame::InitChildReflowSta static void CacheRowHeightsForPrinting(nsPresContext* aPresContext, nsTableRowFrame* aFirstRow) { for (nsTableRowFrame* row = aFirstRow; row; row = row->GetNextRow()) { if (!row->GetPrevInFlow()) { row->SetHasUnpaginatedHeight(true); - row->SetUnpaginatedHeight(aPresContext, row->GetSize().height); + row->SetUnpaginatedHeight(aPresContext, row->GetPhysicalSize().height); } } } nsresult nsTableRowGroupFrame::ReflowChildren(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, nsRowGroupReflowState& aReflowState, @@ -352,17 +352,17 @@ nsTableRowGroupFrame::ReflowChildren(nsP haveRow = true; // Reflow the row frame if (reflowAllKids || NS_SUBTREE_DIRTY(kidFrame) || (aReflowState.reflowState.mFlags.mSpecialHeightReflow && (isPaginated || (kidFrame->GetStateBits() & NS_FRAME_CONTAINS_RELATIVE_HEIGHT)))) { - nsRect oldKidRect = kidFrame->GetRect(); + nsRect oldKidRect = kidFrame->GetPhysicalRect(); nsRect oldKidVisualOverflow = kidFrame->GetVisualOverflowRect(); // XXXldb We used to only pass aDesiredSize.mFlags through for the // incremental reflow codepath. nsHTMLReflowMetrics desiredSize(aDesiredSize.mFlags); desiredSize.width = desiredSize.height = 0; // Reflow the child into the available space, giving it as much height as @@ -378,17 +378,17 @@ nsTableRowGroupFrame::ReflowChildren(nsP // This can indicate that columns were resized. if (aReflowState.reflowState.mFlags.mHResize) kidReflowState.mFlags.mHResize = true; NS_ASSERTION(kidFrame == mFrames.FirstChild() || prevKidFrame, "If we're not on the first frame, we should have a " "previous sibling..."); // If prev row has nonzero YMost, then we can't be at the top of the page - if (prevKidFrame && prevKidFrame->GetRect().YMost() > 0) { + if (prevKidFrame && prevKidFrame->GetPhysicalRect().YMost() > 0) { kidReflowState.mFlags.mIsTopOfPage = false; } rv = ReflowChild(kidFrame, aPresContext, desiredSize, kidReflowState, 0, aReflowState.y, 0, aStatus); // Place the child PlaceChild(aPresContext, aReflowState, kidFrame, desiredSize, @@ -422,17 +422,17 @@ nsTableRowGroupFrame::ReflowChildren(nsP if (nextRow) { *aPageBreakBeforeEnd = nsTableFrame::PageBreakAfter(kidFrame, nextRow); } } } else { SlideChild(aReflowState, kidFrame); // Adjust the running y-offset so we know where the next row should be placed - nscoord height = kidFrame->GetSize().height + cellSpacingY; + nscoord height = kidFrame->GetPhysicalSize().height + cellSpacingY; aReflowState.y += height; if (NS_UNCONSTRAINEDSIZE != aReflowState.availSize.height) { aReflowState.availSize.height -= height; } } ConsiderChildOverflow(aDesiredSize.mOverflowAreas, kidFrame); } @@ -531,17 +531,17 @@ nsTableRowGroupFrame::CalculateRowHeight int32_t startRowIndex = GetStartRowIndex(); // find the row corresponding to the row index we just found nsTableRowFrame* startRowFrame = GetFirstRow(); if (!startRowFrame) return; // the current row group height is the y origin of the 1st row we are about to calculated a height for - nscoord startRowGroupHeight = startRowFrame->GetPosition().y; + nscoord startRowGroupHeight = startRowFrame->GetPhysicalPosition().y; int32_t numRows = GetRowCount() - (startRowFrame->GetRowIndex() - GetStartRowIndex()); // collect the current height of each row. nscoord* rowHeights = nullptr; if (numRows <= 0) return; nsTArray rowInfo; if (!rowInfo.AppendElements(numRows)) { @@ -555,17 +555,17 @@ nsTableRowGroupFrame::CalculateRowHeight // the largest desired height of each cell, the largest style height of each cell, // the style height of the row. nscoord pctHeightBasis = GetHeightBasis(aReflowState); int32_t rowIndex; // the index in rowInfo, not among the rows in the row group nsTableRowFrame* rowFrame; for (rowFrame = startRowFrame, rowIndex = 0; rowFrame; rowFrame = rowFrame->GetNextRow(), rowIndex++) { nscoord nonPctHeight = rowFrame->GetContentHeight(); if (isPaginated) { - nonPctHeight = std::max(nonPctHeight, rowFrame->GetSize().height); + nonPctHeight = std::max(nonPctHeight, rowFrame->GetPhysicalSize().height); } if (!rowFrame->GetPrevInFlow()) { if (rowFrame->HasPctHeight()) { rowInfo[rowIndex].hasPctHeight = true; rowInfo[rowIndex].pctHeight = rowFrame->GetHeight(pctHeightBasis); } rowInfo[rowIndex].hasStyleHeight = rowFrame->HasStyleHeight(); nonPctHeight = std::max(nonPctHeight, rowFrame->GetFixedHeight()); @@ -626,17 +626,17 @@ nsTableRowGroupFrame::CalculateRowHeight cellSpacingTotal += cellSpacingY; } if (rowInfo[rowIndex + spanX].isSpecial) { numSpecialRowsSpanned++; } } nscoord heightOfAreaSpanned = heightOfRowsSpanned + cellSpacingTotal; // get the height of the cell - nsSize cellFrameSize = cellFrame->GetSize(); + nsSize cellFrameSize = cellFrame->GetPhysicalSize(); nsSize cellDesSize = cellFrame->GetDesiredSize(); rowFrame->CalculateCellActualHeight(cellFrame, cellDesSize.height); cellFrameSize.height = cellDesSize.height; if (cellFrame->HasVerticalAlignBaseline()) { // to ensure that a spanning cell with a long descender doesn't // collide with the next row, we need to take into account the shift // that will be done to align the cell on the baseline of the row. cellFrameSize.height += rowFrame->GetMaxCellAscent() - @@ -755,17 +755,17 @@ nsTableRowGroupFrame::CalculateRowHeight } } rowGroupHeight = aReflowState.ComputedHeight(); } nscoord yOrigin = startRowGroupHeight; // update the rows with their (potentially) new heights for (rowFrame = startRowFrame, rowIndex = 0; rowFrame; rowFrame = rowFrame->GetNextRow(), rowIndex++) { - nsRect rowBounds = rowFrame->GetRect(); + nsRect rowBounds = rowFrame->GetPhysicalRect(); nsRect rowVisualOverflow = rowFrame->GetVisualOverflowRect(); bool movedFrame = (rowBounds.y != yOrigin); nscoord rowHeight = (rowInfo[rowIndex].height > 0) ? rowInfo[rowIndex].height : 0; if (movedFrame || (rowHeight != rowBounds.height)) { // Resize/move the row to its final size and position if (movedFrame) { @@ -814,17 +814,17 @@ nsTableRowGroupFrame::CollapseRowGroupIf while (rowFrame) { yGroupOffset += rowFrame->CollapseRowIfNecessary(yGroupOffset, aWidth, collapseGroup, didCollapse); ConsiderChildOverflow(overflow, rowFrame); rowFrame = rowFrame->GetNextRow(); } - nsRect groupRect = GetRect(); + nsRect groupRect = GetPhysicalRect(); nsRect oldGroupRect = groupRect; nsRect oldGroupVisualOverflow = GetVisualOverflowRect(); groupRect.height -= yGroupOffset; if (didCollapse) { // add back the cellspacing between rowgroups groupRect.height += tableFrame->GetCellSpacingY(); } @@ -847,17 +847,17 @@ nsTableRowGroupFrame::CollapseRowGroupIf } // Move a child that was skipped during a reflow. void nsTableRowGroupFrame::SlideChild(nsRowGroupReflowState& aReflowState, nsIFrame* aKidFrame) { // Move the frame if we need to - nsPoint oldPosition = aKidFrame->GetPosition(); + nsPoint oldPosition = aKidFrame->GetPhysicalPosition(); nsPoint newPosition = oldPosition; newPosition.y = aReflowState.y; if (oldPosition.y != newPosition.y) { aKidFrame->InvalidateFrameSubtree(); aKidFrame->SetPosition(newPosition); nsTableFrame::RePositionViews(aKidFrame); aKidFrame->InvalidateFrameSubtree(); } @@ -905,32 +905,32 @@ nsTableRowGroupFrame::SplitSpanningCells const bool borderCollapse = aTable.IsBorderCollapse(); int32_t lastRowIndex = aLastRow.GetRowIndex(); bool wasLast = false; bool haveRowSpan = false; // Iterate the rows between aFirstRow and aLastRow for (nsTableRowFrame* row = &aFirstRow; !wasLast; row = row->GetNextRow()) { wasLast = (row == &aLastRow); int32_t rowIndex = row->GetRowIndex(); - nsPoint rowPos = row->GetPosition(); + nsPoint rowPos = row->GetPhysicalPosition(); // Iterate the cells looking for those that have rowspan > 1 for (nsTableCellFrame* cell = row->GetFirstCell(); cell; cell = cell->GetNextCell()) { int32_t rowSpan = aTable.GetEffectiveRowSpan(rowIndex, *cell); // Only reflow rowspan > 1 cells which span aLastRow. Those which don't span aLastRow // were reflowed correctly during the unconstrained height reflow. if ((rowSpan > 1) && (rowIndex + rowSpan > lastRowIndex)) { haveRowSpan = true; nsReflowStatus status; // Ask the row to reflow the cell to the height of all the rows it spans up through aLastRow // aAvailHeight is the space between the row group start and the end of the page nscoord cellAvailHeight = aSpanningRowBottom - rowPos.y; NS_ASSERTION(cellAvailHeight >= 0, "No space for cell?"); bool isTopOfPage = (row == &aFirstRow) && aFirstRowIsTopOfPage; - nsRect rowRect = row->GetRect(); + nsRect rowRect = row->GetPhysicalRect(); nsSize rowAvailSize(aReflowState.availableWidth, std::max(aReflowState.availableHeight - rowRect.y, 0)); // don't let the available height exceed what // CalculateRowHeights set for it rowAvailSize.height = std::min(rowAvailSize.height, rowRect.height); nsHTMLReflowState rowReflowState(&aPresContext, aReflowState, row, rowAvailSize, @@ -969,17 +969,17 @@ nsTableRowGroupFrame::SplitSpanningCells aContRow->InsertCellFrame(contCell, colIndex); } } } } } } if (!haveRowSpan) { - aDesiredHeight = aLastRow.GetRect().YMost(); + aDesiredHeight = aLastRow.GetPhysicalRect().YMost(); } } // Remove the next-in-flow of the row, its cells and their cell blocks. This // is necessary in case the row doesn't need a continuation later on or needs // a continuation which doesn't have the same number of cells that now exist. void nsTableRowGroupFrame::UndoContinuedRow(nsPresContext* aPresContext, @@ -1051,17 +1051,17 @@ nsTableRowGroupFrame::SplitRowGroup(nsPr // Need to dirty the table's geometry, or else the row might skip // reflowing its cell as an optimization. aTableFrame->SetGeometryDirty(); // Walk each of the row frames looking for the first row frame that doesn't fit // in the available space for (nsTableRowFrame* rowFrame = firstRowThisPage; rowFrame; rowFrame = rowFrame->GetNextRow()) { bool rowIsOnPage = true; - nsRect rowRect = rowFrame->GetRect(); + nsRect rowRect = rowFrame->GetPhysicalRect(); // See if the row fits on this page if (rowRect.YMost() > availHeight) { nsTableRowFrame* contRow = nullptr; // Reflow the row in the availabe space and have it split if it is the 1st // row (on the page) or there is at least 5% of the current page available // XXX this 5% should be made a preference if (!prevRowFrame || (availHeight - aDesiredSize.height > pageHeight / 20)) { nsSize availSize(availWidth, std::max(availHeight - rowRect.y, 0)); @@ -1073,17 +1073,17 @@ nsTableRowGroupFrame::SplitRowGroup(nsPr -1, -1, nsHTMLReflowState::CALLER_WILL_INIT); InitChildReflowState(*aPresContext, borderCollapse, rowReflowState); rowReflowState.mFlags.mIsTopOfPage = isTopOfPage; // set top of page nsHTMLReflowMetrics rowMetrics; // Get the old size before we reflow. - nsRect oldRowRect = rowFrame->GetRect(); + nsRect oldRowRect = rowFrame->GetPhysicalRect(); nsRect oldRowVisualOverflow = rowFrame->GetVisualOverflowRect(); // Reflow the cell with the constrained height. A cell with rowspan >1 will get this // reflow later during SplitSpanningCells. rv = ReflowChild(rowFrame, aPresContext, rowMetrics, rowReflowState, 0, 0, NS_FRAME_NO_MOVE_FRAME, aStatus); if (NS_FAILED(rv)) return rv; rowFrame->SetSize(nsSize(rowMetrics.width, rowMetrics.height)); @@ -1157,17 +1157,17 @@ nsTableRowGroupFrame::SplitRowGroup(nsPr nscoord spanningRowBottom = availHeight; if (!rowIsOnPage) { NS_ASSERTION(!contRow, "We should not have created a continuation if none of this row fits"); if (!aRowForcedPageBreak && ShouldAvoidBreakInside(aReflowState)) { aStatus = NS_INLINE_LINE_BREAK_BEFORE(); break; } if (prevRowFrame) { - spanningRowBottom = prevRowFrame->GetRect().YMost(); + spanningRowBottom = prevRowFrame->GetPhysicalRect().YMost(); lastRowThisPage = prevRowFrame; isTopOfPage = (lastRowThisPage == firstRowThisPage) && aReflowState.mFlags.mIsTopOfPage; aStatus = NS_FRAME_NOT_COMPLETE; } else { // We can't push children, so let our parent reflow us again with more space aDesiredSize.height = rowRect.YMost(); aStatus = NS_FRAME_COMPLETE; @@ -1194,17 +1194,17 @@ nsTableRowGroupFrame::SplitRowGroup(nsPr UndoContinuedRow(aPresContext, contRow); contRow = nullptr; } } else { // (firstTruncatedRow != firstRowThisPage) // Try to put firstTruncateRow on the next page nsTableRowFrame* rowBefore = ::GetRowBefore(*firstRowThisPage, *firstTruncatedRow); nscoord oldSpanningRowBottom = spanningRowBottom; - spanningRowBottom = rowBefore->GetRect().YMost(); + spanningRowBottom = rowBefore->GetPhysicalRect().YMost(); UndoContinuedRow(aPresContext, contRow); contRow = nullptr; nsTableRowFrame* oldLastRowThisPage = lastRowThisPage; lastRowThisPage = rowBefore; aStatus = NS_FRAME_NOT_COMPLETE; // Call SplitSpanningCells again with rowBefore as the last row on the page @@ -1481,29 +1481,29 @@ nsTableRowGroupFrame::RemoveFrame(ChildL tableFrame->SetGeometryDirty(); } mFrames.DestroyFrame(aOldFrame); return NS_OK; } /* virtual */ nsMargin -nsTableRowGroupFrame::GetUsedMargin() const +nsTableRowGroupFrame::GetUsedPhysicalMargin() const { return nsMargin(0,0,0,0); } /* virtual */ nsMargin -nsTableRowGroupFrame::GetUsedBorder() const +nsTableRowGroupFrame::GetUsedPhysicalBorder() const { return nsMargin(0,0,0,0); } /* virtual */ nsMargin -nsTableRowGroupFrame::GetUsedPadding() const +nsTableRowGroupFrame::GetUsedPhysicalPadding() const { return nsMargin(0,0,0,0); } nscoord nsTableRowGroupFrame::GetHeightBasis(const nsHTMLReflowState& aReflowState) { nscoord result = 0; @@ -1674,17 +1674,17 @@ nsTableRowGroupFrame::GetLine(int32_t return NS_OK; } int32_t colCount = table->GetColCount(); for (int32_t i = 0; i < colCount; i++) { CellData* data = cellMap->GetDataAt(aLineNumber, i); if (data && data->IsOrig()) { *aFirstFrameOnLine = (nsIFrame*)data->GetCellFrame(); nsIFrame* parent = (*aFirstFrameOnLine)->GetParent(); - aLineBounds = parent->GetRect(); + aLineBounds = parent->GetPhysicalRect(); return NS_OK; } } NS_ERROR("cellmap is lying"); return NS_ERROR_FAILURE; } int32_t @@ -1747,31 +1747,31 @@ nsTableRowGroupFrame::FindFrameAt(int32_ bool isRTL = (NS_STYLE_DIRECTION_RTL == table->StyleVisibility()->mDirection); nsIFrame* closestFromLeft = nullptr; nsIFrame* closestFromRight = nullptr; int32_t n = numCells; nsIFrame* firstFrame = frame; while (n--) { - nsRect rect = frame->GetRect(); + nsRect rect = frame->GetPhysicalRect(); if (rect.width > 0) { // If aX is inside this frame - this is it if (rect.x <= aX && rect.XMost() > aX) { closestFromLeft = closestFromRight = frame; break; } if (rect.x < aX) { if (!closestFromLeft || - rect.XMost() > closestFromLeft->GetRect().XMost()) + rect.XMost() > closestFromLeft->GetPhysicalRect().XMost()) closestFromLeft = frame; } else { if (!closestFromRight || - rect.x < closestFromRight->GetRect().x) + rect.x < closestFromRight->GetPhysicalRect().x) closestFromRight = frame; } } frame = frame->GetNextSibling(); } if (!closestFromLeft && !closestFromRight) { // All frames were zero-width. Just take the first one. closestFromLeft = closestFromRight = firstFrame; @@ -1783,19 +1783,19 @@ nsTableRowGroupFrame::FindFrameAt(int32_ } else if (!closestFromLeft) { *aFrameFound = closestFromRight; } else if (!closestFromRight) { *aFrameFound = closestFromLeft; } else { // we're between two frames - nscoord delta = closestFromRight->GetRect().x - - closestFromLeft->GetRect().XMost(); - if (aX < closestFromLeft->GetRect().XMost() + delta/2) + nscoord delta = closestFromRight->GetPhysicalRect().x - + closestFromLeft->GetPhysicalRect().XMost(); + if (aX < closestFromLeft->GetPhysicalRect().XMost() + delta/2) *aFrameFound = closestFromLeft; else *aFrameFound = closestFromRight; } return NS_OK; } NS_IMETHODIMP @@ -1871,52 +1871,52 @@ nsTableRowGroupFrame::GetFirstRowContain // we don't need to check that here. // We use property->mOverflowBelow here instead of computing the frame's // true overflowArea.YMost(), because it is essential for the thresholds // to form a monotonically increasing sequence. Otherwise we would break // encountering a row whose overflowArea.YMost() is <= aY but which has // a row above it containing cell(s) that span to include aY. while (cursorIndex > 0 && - cursorFrame->GetRect().YMost() + property->mOverflowBelow > aY) { + cursorFrame->GetPhysicalRect().YMost() + property->mOverflowBelow > aY) { --cursorIndex; cursorFrame = property->mFrames[cursorIndex]; } while (cursorIndex + 1 < frameCount && - cursorFrame->GetRect().YMost() + property->mOverflowBelow <= aY) { + cursorFrame->GetPhysicalRect().YMost() + property->mOverflowBelow <= aY) { ++cursorIndex; cursorFrame = property->mFrames[cursorIndex]; } property->mCursorIndex = cursorIndex; *aOverflowAbove = property->mOverflowAbove; return cursorFrame; } bool nsTableRowGroupFrame::FrameCursorData::AppendFrame(nsIFrame* aFrame) { nsRect overflowRect = aFrame->GetVisualOverflowRect(); if (overflowRect.IsEmpty()) return true; nscoord overflowAbove = -overflowRect.y; - nscoord overflowBelow = overflowRect.YMost() - aFrame->GetSize().height; + nscoord overflowBelow = overflowRect.YMost() - aFrame->GetPhysicalSize().height; mOverflowAbove = std::max(mOverflowAbove, overflowAbove); mOverflowBelow = std::max(mOverflowBelow, overflowBelow); return mFrames.AppendElement(aFrame) != nullptr; } void nsTableRowGroupFrame::InvalidateFrame(uint32_t aDisplayItemKey) { nsIFrame::InvalidateFrame(aDisplayItemKey); - GetParent()->InvalidateFrameWithRect(GetVisualOverflowRect() + GetPosition(), aDisplayItemKey); + GetParent()->InvalidateFrameWithRect(GetVisualOverflowRect() + GetPhysicalPosition(), aDisplayItemKey); } void nsTableRowGroupFrame::InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey) { nsIFrame::InvalidateFrameWithRect(aRect, aDisplayItemKey); // If we have filters applied that would affects our bounds, then // we get an inactive layer created and this is computed // within FrameLayerBuilder - GetParent()->InvalidateFrameWithRect(aRect + GetPosition(), aDisplayItemKey); + GetParent()->InvalidateFrameWithRect(aRect + GetPhysicalPosition(), aDisplayItemKey); } diff --git a/layout/tables/nsTableRowGroupFrame.h b/layout/tables/nsTableRowGroupFrame.h --- a/layout/tables/nsTableRowGroupFrame.h +++ b/layout/tables/nsTableRowGroupFrame.h @@ -84,19 +84,19 @@ public: NS_IMETHOD InsertFrames(ChildListID aListID, nsIFrame* aPrevFrame, nsFrameList& aFrameList) MOZ_OVERRIDE; NS_IMETHOD RemoveFrame(ChildListID aListID, nsIFrame* aOldFrame) MOZ_OVERRIDE; - virtual nsMargin GetUsedMargin() const MOZ_OVERRIDE; - virtual nsMargin GetUsedBorder() const MOZ_OVERRIDE; - virtual nsMargin GetUsedPadding() const MOZ_OVERRIDE; + virtual nsMargin GetUsedPhysicalMargin() const MOZ_OVERRIDE; + virtual nsMargin GetUsedPhysicalBorder() const MOZ_OVERRIDE; + virtual nsMargin GetUsedPhysicalPadding() const MOZ_OVERRIDE; virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder, const nsRect& aDirtyRect, const nsDisplayListSet& aLists) MOZ_OVERRIDE; /** calls Reflow for all of its child rows. * Rows are all set to the same width and stacked vertically. *

rows are not split unless absolutely necessary. @@ -306,17 +306,17 @@ public: /** * Get the first row that might contain y-coord 'aY', or nullptr if you must search * all rows. * The actual row returned might not contain 'aY', but if not, it is guaranteed * to be before any row which does contain 'aY'. * aOverflowAbove is the maximum over all rows of -row.GetOverflowRect().y. * To find all rows that intersect the vertical interval aY/aYMost, call * GetFirstRowContaining(aY, &overflowAbove), and then iterate through all - * rows until reaching a row where row->GetRect().y - overflowAbove >= aYMost. + * rows until reaching a row where row->GetPhysicalRect().y - overflowAbove >= aYMost. * That row and all subsequent rows cannot intersect the interval. */ nsIFrame* GetFirstRowContaining(nscoord aY, nscoord* aOverflowAbove); /** * Set up the row cursor. After this, call AppendFrame for every * child frame in sibling order. Ensure that the child frame y and YMost values * form non-decreasing sequences (should always be true for table rows); diff --git a/layout/xul/base/src/nsBox.cpp b/layout/xul/base/src/nsBox.cpp --- a/layout/xul/base/src/nsBox.cpp +++ b/layout/xul/base/src/nsBox.cpp @@ -551,28 +551,28 @@ nsBox::SyncLayout(nsBoxLayoutState& aSta flags |= stateFlags; nsRect visualOverflow; if (ComputesOwnOverflowArea()) { visualOverflow = GetVisualOverflowRect(); } else { - nsRect rect(nsPoint(0, 0), GetSize()); + nsRect rect(nsPoint(0, 0), GetPhysicalSize()); nsOverflowAreas overflowAreas(rect, rect); if (!DoesClipChildren() && !IsCollapsed()) { // See if our child frames caused us to overflow after being laid // out. If so, store the overflow area. This normally can't happen // in XUL, but it can happen with the CSS 'outline' property and // possibly with other exotic stuff (e.g. relatively positioned // frames in HTML inside XUL). nsLayoutUtils::UnionChildOverflow(this, overflowAreas); } - FinishAndStoreOverflow(overflowAreas, GetSize()); + FinishAndStoreOverflow(overflowAreas, GetPhysicalSize()); visualOverflow = overflowAreas.VisualOverflow(); } nsView* view = GetView(); if (view) { // Make sure the frame's view is properly sized and positioned and has // things like opacity correct nsContainerFrame::SyncFrameViewAfterReflow(presContext, this, view, @@ -931,17 +931,17 @@ nsBox::SetDebug(nsBoxLayoutState& aState { return NS_OK; } NS_IMETHODIMP nsBox::GetDebugBoxAt( const nsPoint& aPoint, nsIFrame** aBox) { - nsRect thisRect(nsPoint(0,0), GetSize()); + nsRect thisRect(nsPoint(0,0), GetPhysicalSize()); if (!thisRect.Contains(aPoint)) return NS_ERROR_FAILURE; nsIFrame* child = GetChildBox(); nsIFrame* hit = nullptr; *aBox = nullptr; while (nullptr != child) { diff --git a/layout/xul/base/src/nsBoxFrame.cpp b/layout/xul/base/src/nsBoxFrame.cpp --- a/layout/xul/base/src/nsBoxFrame.cpp +++ b/layout/xul/base/src/nsBoxFrame.cpp @@ -1305,17 +1305,17 @@ nsBoxFrame::BuildDisplayList(nsDisplayLi GetContent()->HasAttr(kNameSpaceID_None, nsGkAtoms::layer) && GetContent()->IsXUL(); // Check for frames that are marked as a part of the region used // in calculating glass margins on Windows. if (GetContent()->IsXUL()) { const nsStyleDisplay* styles = StyleDisplay(); if (styles && styles->mAppearance == NS_THEME_WIN_EXCLUDE_GLASS) { - nsRect rect = nsRect(aBuilder->ToReferenceFrame(this), GetSize()); + nsRect rect = nsRect(aBuilder->ToReferenceFrame(this), GetPhysicalSize()); aBuilder->AddExcludedGlassRegion(rect); } } nsDisplayListCollection tempLists; const nsDisplayListSet& destination = forceLayer ? tempLists : aLists; DisplayBorderBackgroundOutline(aBuilder, destination); @@ -1834,17 +1834,17 @@ nsBoxFrame::SetDebugOnChildList(nsBoxLay child->SetDebug(aState, aDebug); child = child->GetNextBox(); } } nsresult nsBoxFrame::GetFrameSizeWithMargin(nsIFrame* aBox, nsSize& aSize) { - nsRect rect(aBox->GetRect()); + nsRect rect(aBox->GetPhysicalRect()); nsMargin margin(0,0,0,0); aBox->GetMargin(margin); rect.Inflate(margin); aSize.width = rect.width; aSize.height = rect.height; return NS_OK; } #endif @@ -1912,17 +1912,17 @@ nsBoxFrame::CheckBoxOrder() nsLayoutUtils::SortFrameList(mFrames); } } nsresult nsBoxFrame::LayoutChildAt(nsBoxLayoutState& aState, nsIFrame* aBox, const nsRect& aRect) { // get the current rect - nsRect oldRect(aBox->GetRect()); + nsRect oldRect(aBox->GetPhysicalRect()); aBox->SetBounds(aState, aRect); bool layout = NS_SUBTREE_DIRTY(aBox); if (layout || (oldRect.width != aRect.width || oldRect.height != aRect.height)) { return aBox->Layout(aState); } diff --git a/layout/xul/base/src/nsBoxObject.cpp b/layout/xul/base/src/nsBoxObject.cpp --- a/layout/xul/base/src/nsBoxObject.cpp +++ b/layout/xul/base/src/nsBoxObject.cpp @@ -171,17 +171,17 @@ nsBoxObject::GetOffsetRect(nsIntRect& aR // If we've hit the document element, break here if (parent->GetContent() == docElement) { break; } nsIFrame* next = parent->GetParent(); if (!next) { NS_WARNING("We should have hit the document element..."); - origin += parent->GetPosition(); + origin += parent->GetPhysicalPosition(); break; } // Add the parent's origin to our own to get to the // right coordinate system origin += next->GetPositionOfChildIgnoringScrolling(parent); parent = next; } diff --git a/layout/xul/base/src/nsGroupBoxFrame.cpp b/layout/xul/base/src/nsGroupBoxFrame.cpp --- a/layout/xul/base/src/nsGroupBoxFrame.cpp +++ b/layout/xul/base/src/nsGroupBoxFrame.cpp @@ -194,17 +194,17 @@ nsGroupBoxFrame::PaintBorderBackground(n aRenderingContext.IntersectClip(clipRect); nsCSSRendering::PaintBorder(presContext, aRenderingContext, this, aDirtyRect, rect, mStyleContext, skipSides); aRenderingContext.PopState(); } else { nsCSSRendering::PaintBorder(presContext, aRenderingContext, this, - aDirtyRect, nsRect(aPt, GetSize()), + aDirtyRect, nsRect(aPt, GetPhysicalSize()), mStyleContext, skipSides); } } nsIFrame* nsGroupBoxFrame::GetCaptionBox(nsPresContext* aPresContext, nsRect& aCaptionRect) { // first child is our grouped area @@ -221,18 +221,18 @@ nsGroupBoxFrame::GetCaptionBox(nsPresCon if (!box) return nullptr; // now get the caption itself. It is in the caption frame. nsIFrame* child = box->GetChildBox(); if (child) { // convert to our coordinates. - nsRect parentRect(box->GetRect()); - aCaptionRect = child->GetRect(); + nsRect parentRect(box->GetPhysicalRect()); + aCaptionRect = child->GetPhysicalRect(); aCaptionRect.x += parentRect.x; aCaptionRect.y += parentRect.y; } return child; } NS_IMETHODIMP diff --git a/layout/xul/base/src/nsImageBoxFrame.h b/layout/xul/base/src/nsImageBoxFrame.h --- a/layout/xul/base/src/nsImageBoxFrame.h +++ b/layout/xul/base/src/nsImageBoxFrame.h @@ -138,17 +138,17 @@ public: #endif virtual already_AddRefed GetContainer(LayerManager* aManager, nsDisplayListBuilder* aBuilder) MOZ_OVERRIDE; virtual void ConfigureLayer(ImageLayer* aLayer, const nsIntPoint& aOffset) MOZ_OVERRIDE; virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap) MOZ_OVERRIDE { *aSnap = true; - return nsRect(ToReferenceFrame(), Frame()->GetSize()); + return nsRect(ToReferenceFrame(), Frame()->GetPhysicalSize()); } virtual void ComputeInvalidationRegion(nsDisplayListBuilder* aBuilder, const nsDisplayItemGeometry* aGeometry, nsRegion* aInvalidRegion) MOZ_OVERRIDE; // Doesn't handle HitTest because nsLeafBoxFrame already creates an // event receiver for us virtual void Paint(nsDisplayListBuilder* aBuilder, nsRenderingContext* aCtx) MOZ_OVERRIDE; diff --git a/layout/xul/base/src/nsListBoxBodyFrame.cpp b/layout/xul/base/src/nsListBoxBodyFrame.cpp --- a/layout/xul/base/src/nsListBoxBodyFrame.cpp +++ b/layout/xul/base/src/nsListBoxBodyFrame.cpp @@ -249,32 +249,32 @@ nsListBoxBodyFrame::DoLayout(nsBoxLayout { if (mScrolling) aBoxLayoutState.SetPaintingDisabled(true); nsresult rv = nsBoxFrame::DoLayout(aBoxLayoutState); // determine the real height for the scrollable area from the total number // of rows, since non-visible rows don't yet have frames - nsRect rect(nsPoint(0, 0), GetSize()); + nsRect rect(nsPoint(0, 0), GetPhysicalSize()); nsOverflowAreas overflow(rect, rect); if (mLayoutManager) { nsIFrame* childFrame = mFrames.FirstChild(); while (childFrame) { ConsiderChildOverflow(overflow, childFrame); childFrame = childFrame->GetNextSibling(); } nsSize prefSize = mLayoutManager->GetPrefSize(this, aBoxLayoutState); NS_FOR_FRAME_OVERFLOW_TYPES(otype) { nsRect& o = overflow.Overflow(otype); o.height = std::max(o.height, prefSize.height); } } - FinishAndStoreOverflow(overflow, GetSize()); + FinishAndStoreOverflow(overflow, GetPhysicalSize()); if (mScrolling) aBoxLayoutState.SetPaintingDisabled(false); // if we are scrolled and the row height changed // make sure we are scrolled to a correct index. if (mAdjustScroll) PostReflowCallback(); diff --git a/layout/xul/base/src/nsListBoxLayout.cpp b/layout/xul/base/src/nsListBoxLayout.cpp --- a/layout/xul/base/src/nsListBoxLayout.cpp +++ b/layout/xul/base/src/nsListBoxLayout.cpp @@ -139,17 +139,17 @@ nsListBoxLayout::LayoutInternal(nsIFrame nsIFrame* box = body->GetChildBox(); // if the reason is resize or initial we must relayout. nscoord rowHeight = body->GetRowHeightAppUnits(); while (box) { // If this box is dirty or if it has dirty children, we // call layout on it. - nsRect childRect(box->GetRect()); + nsRect childRect(box->GetPhysicalRect()); box->GetMargin(margin); // relayout if we must or we are dirty or some of our children are dirty // or the client area is wider than us // XXXldb There should probably be a resize check here too! if (NS_SUBTREE_DIRTY(box) || childRect.width < clientRect.width) { childRect.x = 0; childRect.y = yOffset; diff --git a/layout/xul/base/src/nsMenuPopupFrame.cpp b/layout/xul/base/src/nsMenuPopupFrame.cpp --- a/layout/xul/base/src/nsMenuPopupFrame.cpp +++ b/layout/xul/base/src/nsMenuPopupFrame.cpp @@ -411,40 +411,40 @@ nsMenuPopupFrame::LayoutPopup(nsBoxLayou // get the preferred, minimum and maximum size. If the menu is sized to the // popup, then the popup's width is the menu's width. nsSize prefSize = GetPrefSize(aState); nsSize minSize = GetMinSize(aState); nsSize maxSize = GetMaxSize(aState); if (aSizedToPopup) { - prefSize.width = aParentMenu->GetRect().width; + prefSize.width = aParentMenu->GetPhysicalRect().width; } prefSize = BoundsCheck(minSize, prefSize, maxSize); // if the size changed then set the bounds to be the preferred size bool sizeChanged = (mPrefSize != prefSize); if (sizeChanged) { SetBounds(aState, nsRect(0, 0, prefSize.width, prefSize.height), false); mPrefSize = prefSize; } if (shouldPosition) { SetPopupPosition(aParentMenu, false); } - nsRect bounds(GetRect()); + nsRect bounds(GetPhysicalRect()); Layout(aState); // if the width or height changed, readjust the popup position. This is a // special case for tooltips where the preferred height doesn't include the // real height for its inline element, but does once it is laid out. // This is bug 228673 which doesn't have a simple fix. if (!aParentMenu) { - nsSize newsize = GetSize(); + nsSize newsize = GetPhysicalSize(); if (newsize.width > bounds.width || newsize.height > bounds.height) { // the size after layout was larger than the preferred size, // so set the preferred size accordingly mPrefSize = newsize; if (isOpen) { SetPopupPosition(nullptr, false); } } @@ -458,17 +458,17 @@ nsMenuPopupFrame::LayoutPopup(nsBoxLayou nsIWidget* widget = view->GetWidget(); if (widget) { SetSizeConstraints(pc, widget, minSize, maxSize); } } if (isOpen) { nsViewManager* viewManager = view->GetViewManager(); - nsRect rect = GetRect(); + nsRect rect = GetPhysicalRect(); rect.x = rect.y = 0; viewManager->ResizeView(view, rect); viewManager->SetViewVisibility(view, nsViewVisibility_kShow); mPopupState = ePopupOpenAndVisible; nsContainerFrame::SyncFrameViewProperties(pc, this, nullptr, view, 0); } @@ -1531,17 +1531,17 @@ nsIScrollableFrame* nsMenuPopupFrame::Ge return nullptr; } void nsMenuPopupFrame::EnsureMenuItemIsVisible(nsMenuFrame* aMenuItem) { if (aMenuItem) { aMenuItem->PresContext()->PresShell()->ScrollFrameRectIntoView( aMenuItem, - nsRect(nsPoint(0,0), aMenuItem->GetRect().Size()), + nsRect(nsPoint(0,0), aMenuItem->GetPhysicalRect().Size()), nsIPresShell::ScrollAxis(), nsIPresShell::ScrollAxis(), nsIPresShell::SCROLL_OVERFLOW_HIDDEN | nsIPresShell::SCROLL_FIRST_ANCESTOR_ONLY); } } NS_IMETHODIMP nsMenuPopupFrame::SetCurrentMenuItem(nsMenuFrame* aMenuItem) @@ -2046,17 +2046,17 @@ nsMenuPopupFrame::CreatePopupView() nsView* parentView = viewManager->GetRootView(); nsViewVisibility visibility = nsViewVisibility_kHide; int32_t zIndex = INT32_MAX; bool autoZIndex = false; NS_ASSERTION(parentView, "no parent view"); // Create a view - nsView *view = viewManager->CreateView(GetRect(), parentView, visibility); + nsView *view = viewManager->CreateView(GetPhysicalRect(), parentView, visibility); viewManager->SetViewZIndex(view, autoZIndex, zIndex); // XXX put view last in document order until we can do better viewManager->InsertChild(parentView, view, nullptr, true); // Remember our view SetView(view); NS_FRAME_LOG(NS_FRAME_TRACE_CALLS, diff --git a/layout/xul/base/src/nsResizerFrame.cpp b/layout/xul/base/src/nsResizerFrame.cpp --- a/layout/xul/base/src/nsResizerFrame.cpp +++ b/layout/xul/base/src/nsResizerFrame.cpp @@ -79,19 +79,19 @@ nsResizerFrame::HandleEvent(nsPresContex break; // cache the content rectangle for the frame to resize // GetScreenRectInAppUnits returns the border box rectangle, so // adjust to get the desired content rectangle. nsRect rect = frameToResize->GetScreenRectInAppUnits(); switch (frameToResize->StylePosition()->mBoxSizing) { case NS_STYLE_BOX_SIZING_CONTENT: - rect.Deflate(frameToResize->GetUsedPadding()); + rect.Deflate(frameToResize->GetUsedPhysicalPadding()); case NS_STYLE_BOX_SIZING_PADDING: - rect.Deflate(frameToResize->GetUsedBorder()); + rect.Deflate(frameToResize->GetUsedPhysicalBorder()); default: break; } mMouseDownRect = rect.ToNearestPixels(aPresContext->AppUnitsPerDevPixel()); doDefault = false; } else { diff --git a/layout/xul/base/src/nsScrollBoxObject.cpp b/layout/xul/base/src/nsScrollBoxObject.cpp --- a/layout/xul/base/src/nsScrollBoxObject.cpp +++ b/layout/xul/base/src/nsScrollBoxObject.cpp @@ -132,17 +132,17 @@ NS_IMETHODIMP nsScrollBoxObject::ScrollB if (!shell) { return NS_ERROR_UNEXPECTED; } frameWidth = nsPresContext::CSSPixelsToAppUnits(frameWidth); } // first find out what index we are currently at while(child) { - rect = child->GetRect(); + rect = child->GetPhysicalRect(); if (horiz) { // In the left-to-right case we break from the loop when the center of // the current child rect is greater than the scrolled position of // the left edge of the scrollbox // In the right-to-left case we break when the center of the current // child rect is less than the scrolled position of the right edge of // the scrollbox. diff = rect.x + rect.width/2; // use the center, to avoid rounding errors @@ -164,26 +164,26 @@ NS_IMETHODIMP nsScrollBoxObject::ScrollB if (dindexes == 0) return NS_OK; if (dindexes > 0) { while(child) { child = child->GetNextBox(); if (child) - rect = child->GetRect(); + rect = child->GetPhysicalRect(); count++; if (count >= dindexes) break; } } else if (dindexes < 0) { child = scrolledBox->GetChildBox(); while(child) { - rect = child->GetRect(); + rect = child->GetPhysicalRect(); if (count >= curIndex + dindexes) break; count++; child = child->GetNextBox(); } } @@ -274,17 +274,17 @@ NS_IMETHODIMP nsScrollBoxObject::GetPosi /* void getScrolledSize (out long width, out long height); */ NS_IMETHODIMP nsScrollBoxObject::GetScrolledSize(int32_t *width, int32_t *height) { nsIFrame* scrolledBox = GetScrolledBox(this); if (!scrolledBox) return NS_ERROR_FAILURE; - nsRect scrollRect = scrolledBox->GetRect(); + nsRect scrollRect = scrolledBox->GetPhysicalRect(); *width = nsPresContext::AppUnitsToIntCSSPixels(scrollRect.width); *height = nsPresContext::AppUnitsToIntCSSPixels(scrollRect.height); return NS_OK; } /* void ensureElementIsVisible (in nsIDOMElement child); */ diff --git a/layout/xul/base/src/nsScrollbarButtonFrame.cpp b/layout/xul/base/src/nsScrollbarButtonFrame.cpp --- a/layout/xul/base/src/nsScrollbarButtonFrame.cpp +++ b/layout/xul/base/src/nsScrollbarButtonFrame.cpp @@ -64,17 +64,17 @@ nsScrollbarButtonFrame::HandleEvent(nsPr HandleRelease(aPresContext, aEvent, aEventStatus); break; case NS_MOUSE_EXIT_SYNTH: mCursorOnThis = false; break; case NS_MOUSE_MOVE: { nsPoint cursor = nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, this); - nsRect frameRect(nsPoint(0, 0), GetSize()); + nsRect frameRect(nsPoint(0, 0), GetPhysicalSize()); mCursorOnThis = frameRect.Contains(cursor); break; } } return nsButtonBoxFrame::HandleEvent(aPresContext, aEvent, aEventStatus); } diff --git a/layout/xul/base/src/nsSliderFrame.cpp b/layout/xul/base/src/nsSliderFrame.cpp --- a/layout/xul/base/src/nsSliderFrame.cpp +++ b/layout/xul/base/src/nsSliderFrame.cpp @@ -302,17 +302,17 @@ void nsSliderFrame::BuildDisplayListForChildren(nsDisplayListBuilder* aBuilder, const nsRect& aDirtyRect, const nsDisplayListSet& aLists) { // if we are too small to have a thumb don't paint it. nsIFrame* thumb = GetChildBox(); if (thumb) { - nsRect thumbRect(thumb->GetRect()); + nsRect thumbRect(thumb->GetPhysicalRect()); nsMargin m; thumb->GetMargin(m); thumbRect.Inflate(m); nsRect crect; GetClientRect(crect); if (crect.width < thumbRect.width || crect.height < thumbRect.height) @@ -392,17 +392,17 @@ nsSliderFrame::DoLayout(nsBoxLayoutState nsGkAtoms::reverse, eCaseMatters); nscoord pos = reverse ? (maxPos - curPos) : (curPos - minPos); // set the thumb's coord to be the current pos * the ratio. nsRect thumbRect(clientRect.x, clientRect.y, thumbSize.width, thumbSize.height); int32_t& thumbPos = (IsHorizontal() ? thumbRect.x : thumbRect.y); thumbPos += NSToCoordRound(pos * mRatio); - nsRect oldThumbRect(thumbBox->GetRect()); + nsRect oldThumbRect(thumbBox->GetPhysicalRect()); LayoutChildAt(aState, thumbBox, thumbRect); SyncLayout(aState); // Redraw only if thumb changed size. if (!oldThumbRect.IsEqualInterior(thumbRect)) Redraw(aState); @@ -454,17 +454,17 @@ nsSliderFrame::HandleEvent(nsPresContext if (!thumbFrame) { return NS_OK; } // take our current position and subtract the start location pos -= mDragStart; bool isMouseOutsideThumb = false; if (gSnapMultiplier) { - nsSize thumbSize = thumbFrame->GetSize(); + nsSize thumbSize = thumbFrame->GetPhysicalSize(); if (isHorizontal) { // horizontal scrollbar - check if mouse is above or below thumb // XXXbz what about looking at the .y of the thumb's rect? Is that // always zero here? if (eventPoint.y < -gSnapMultiplier * thumbSize.height || eventPoint.y > thumbSize.height + gSnapMultiplier * thumbSize.height) isMouseOutsideThumb = true; @@ -515,34 +515,34 @@ nsSliderFrame::HandleEvent(nsPresContext } nscoord pos = isHorizontal ? eventPoint.x : eventPoint.y; // adjust so that the middle of the thumb is placed under the click nsIFrame* thumbFrame = mFrames.FirstChild(); if (!thumbFrame) { return NS_OK; } - nsSize thumbSize = thumbFrame->GetSize(); + nsSize thumbSize = thumbFrame->GetPhysicalSize(); nscoord thumbLength = isHorizontal ? thumbSize.width : thumbSize.height; // set it nsWeakFrame weakFrame(this); // should aMaySnap be true here? SetCurrentThumbPosition(scrollbar, pos - thumbLength/2, false, false); NS_ENSURE_TRUE(weakFrame.IsAlive(), NS_OK); DragThumb(true); if (aEvent->eventStructType == NS_TOUCH_EVENT) { *aEventStatus = nsEventStatus_eConsumeNoDefault; } if (isHorizontal) - mThumbStart = thumbFrame->GetPosition().x; + mThumbStart = thumbFrame->GetPhysicalPosition().x; else - mThumbStart = thumbFrame->GetPosition().y; + mThumbStart = thumbFrame->GetPhysicalPosition().y; mDragStart = pos - mThumbStart; } // XXX hack until handle release is actually called in nsframe. // if (aEvent->message == NS_MOUSE_EXIT_SYNTH || aEvent->message == NS_MOUSE_RIGHT_BUTTON_UP || aEvent->message == NS_MOUSE_LEFT_BUTTON_UP) // HandleRelease(aPresContext, aEvent, aEventStatus); @@ -643,17 +643,17 @@ nsSliderFrame::CurrentPositionChanged() maxPos = std::max(minPos, maxPos); curPos = clamped(curPos, minPos, maxPos); // get the thumb's rect nsIFrame* thumbFrame = mFrames.FirstChild(); if (!thumbFrame) return; // The thumb may stream in asynchronously via XBL. - nsRect thumbRect = thumbFrame->GetRect(); + nsRect thumbRect = thumbFrame->GetPhysicalRect(); nsRect clientRect; GetClientRect(clientRect); // figure out the new rect nsRect newThumbRect(thumbRect); bool reverse = mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::dir, @@ -842,17 +842,17 @@ nsSliderFrame::StartDrag(nsIDOMEvent* aE nscoord newpos = pos; bool scrollToClick = ShouldScrollToClickForEvent(event); if (scrollToClick) { // adjust so that the middle of the thumb is placed under the click nsIFrame* thumbFrame = mFrames.FirstChild(); if (!thumbFrame) { return NS_OK; } - nsSize thumbSize = thumbFrame->GetSize(); + nsSize thumbSize = thumbFrame->GetPhysicalSize(); nscoord thumbLength = isHorizontal ? thumbSize.width : thumbSize.height; newpos -= (thumbLength/2); nsIFrame* scrollbarBox = GetScrollbar(); scrollbar = GetContentOfBox(scrollbarBox); } @@ -864,19 +864,19 @@ nsSliderFrame::StartDrag(nsIDOMEvent* aE } nsIFrame* thumbFrame = mFrames.FirstChild(); if (!thumbFrame) { return NS_OK; } if (isHorizontal) - mThumbStart = thumbFrame->GetPosition().x; + mThumbStart = thumbFrame->GetPhysicalPosition().x; else - mThumbStart = thumbFrame->GetPosition().y; + mThumbStart = thumbFrame->GetPhysicalPosition().y; mDragStart = pos - mThumbStart; #ifdef DEBUG_SLIDER printf("Pressed mDragStart=%d\n",mDragStart); #endif return NS_OK; @@ -999,17 +999,17 @@ nsSliderFrame::IsEventOverThumb(nsGUIEve } nsPoint eventPoint; if (!GetEventPoint(aEvent, eventPoint)) { return false; } bool isHorizontal = IsHorizontal(); - nsRect thumbRect = thumbFrame->GetRect(); + nsRect thumbRect = thumbFrame->GetPhysicalRect(); nscoord eventPos = isHorizontal ? eventPoint.x : eventPoint.y; nscoord thumbStart = isHorizontal ? thumbRect.x : thumbRect.y; nscoord thumbEnd = isHorizontal ? thumbRect.XMost() : thumbRect.YMost(); return eventPos >= thumbStart && eventPos < thumbEnd; } NS_IMETHODIMP @@ -1028,17 +1028,17 @@ nsSliderFrame::HandlePress(nsPresContext nsIFrame* thumbFrame = mFrames.FirstChild(); if (!thumbFrame) // display:none? return NS_OK; if (mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::disabled, nsGkAtoms::_true, eCaseMatters)) return NS_OK; - nsRect thumbRect = thumbFrame->GetRect(); + nsRect thumbRect = thumbFrame->GetPhysicalRect(); nscoord change = 1; nsPoint eventPoint; if (!GetEventPoint(aEvent, eventPoint)) { return NS_OK; } if (IsHorizontal() ? eventPoint.x < thumbRect.x : eventPoint.y < thumbRect.y) @@ -1116,17 +1116,17 @@ void nsSliderFrame::Notify(void) { bool stop = false; nsIFrame* thumbFrame = mFrames.FirstChild(); if (!thumbFrame) { StopRepeat(); return; } - nsRect thumbRect = thumbFrame->GetRect(); + nsRect thumbRect = thumbFrame->GetPhysicalRect(); bool isHorizontal = IsHorizontal(); // See if the thumb has moved past our destination point. // if it has we want to stop. if (isHorizontal) { if (mChange < 0) { if (thumbRect.x < mDestinationPoint.x) diff --git a/layout/xul/base/src/nsSplitterFrame.cpp b/layout/xul/base/src/nsSplitterFrame.cpp --- a/layout/xul/base/src/nsSplitterFrame.cpp +++ b/layout/xul/base/src/nsSplitterFrame.cpp @@ -674,17 +674,17 @@ nsSplitterFrameInner::MouseDown(nsIDOMEv mOuter->AddMargin(childBox, minSize); mOuter->AddMargin(childBox, prefSize); mOuter->AddMargin(childBox, maxSize); nscoord flex = childBox->GetFlex(state); nsMargin margin(0,0,0,0); childBox->GetMargin(margin); - nsRect r(childBox->GetRect()); + nsRect r(childBox->GetPhysicalRect()); r.Inflate(margin); // We need to check for hidden attribute too, since treecols with // the hidden="true" attribute are not really hidden, just collapsed if (!content->AttrValueIs(kNameSpaceID_None, nsGkAtoms::fixed, nsGkAtoms::_true, eCaseMatters) && !content->AttrValueIs(kNameSpaceID_None, nsGkAtoms::hidden, nsGkAtoms::_true, eCaseMatters)) { @@ -936,17 +936,17 @@ nsSplitterFrameInner::AdjustChildren(nsP SetPreferredSize(state, childBox, onePixel, aIsHorizontal, &pref); } } } void nsSplitterFrameInner::SetPreferredSize(nsBoxLayoutState& aState, nsIFrame* aChildBox, nscoord aOnePixel, bool aIsHorizontal, nscoord* aSize) { - nsRect rect(aChildBox->GetRect()); + nsRect rect(aChildBox->GetPhysicalRect()); nscoord pref = 0; if (!aSize) { if (aIsHorizontal) pref = rect.width; else pref = rect.height; diff --git a/layout/xul/base/src/nsSprocketLayout.cpp b/layout/xul/base/src/nsSprocketLayout.cpp --- a/layout/xul/base/src/nsSprocketLayout.cpp +++ b/layout/xul/base/src/nsSprocketLayout.cpp @@ -181,17 +181,17 @@ nsSprocketLayout::Layout(nsIFrame* aBox, } return NS_OK; } nsBoxLayoutState::AutoReflowDepth depth(aState); mozilla::AutoStackArena arena; // ----- figure out our size ---------- - const nsSize originalSize = aBox->GetSize(); + const nsSize originalSize = aBox->GetPhysicalSize(); // -- make sure we remove our border and padding ---- nsRect clientRect; aBox->GetClientRect(clientRect); // |originalClientRect| represents the rect of the entire box (excluding borders // and padding). We store it here because we're going to use |clientRect| to hold // the required size for all our kids. As an example, consider an hbox with a @@ -432,17 +432,17 @@ nsSprocketLayout::Layout(nsIFrame* aBox, if (passes > 0) { layout = false; } else { // Always perform layout if we are dirty or have dirty children if (!NS_SUBTREE_DIRTY(child)) layout = false; } - nsRect oldRect(child->GetRect()); + nsRect oldRect(child->GetPhysicalRect()); // Non-stretch alignment will be handled in AlignChildren(), so don't // change child out-of-axis positions yet. if (!(frameState & NS_STATE_AUTO_STRETCH)) { if (frameState & NS_STATE_IS_HORIZONTAL) { childRect.y = oldRect.y; } else { childRect.x = oldRect.x; @@ -478,17 +478,17 @@ nsSprocketLayout::Layout(nsIFrame* aBox, // If we already determined that layout was required or if our size has changed, then // we make sure to call layout on the child, since its children may need to be shifted // around as a result of the size change. if (layout || sizeChanged) child->Layout(aState); // If the child was a block or inline (e.g., HTML) it may have changed its rect *during* layout. // We have to check for this. - nsRect newChildRect(child->GetRect()); + nsRect newChildRect(child->GetPhysicalRect()); if (!newChildRect.IsEqualInterior(childRect)) { #ifdef DEBUG_GROW child->DumpBox(stdout); printf(" GREW from (%d,%d) -> (%d,%d)\n", childRect.width, childRect.height, newChildRect.width, newChildRect.height); #endif newChildRect.Inflate(margin); childRect.Inflate(margin); @@ -587,17 +587,17 @@ nsSprocketLayout::Layout(nsIFrame* aBox, nsRect tmpClientRect(originalClientRect); nsMargin bp(0,0,0,0); aBox->GetBorderAndPadding(bp); tmpClientRect.Inflate(bp); if (tmpClientRect.width > originalSize.width || tmpClientRect.height > originalSize.height) { // if it did reset our bounds. - nsRect bounds(aBox->GetRect()); + nsRect bounds(aBox->GetPhysicalRect()); if (tmpClientRect.width > originalSize.width) bounds.width = tmpClientRect.width; if (tmpClientRect.height > originalSize.height) bounds.height = tmpClientRect.height; aBox->SetBounds(aState, bounds); } @@ -611,17 +611,17 @@ nsSprocketLayout::Layout(nsIFrame* aBox, // we really did have to change the positions because of packing (typically for 'center' // or 'end' pack values). if (x != origX || y != origY) { nsIFrame* child = aBox->GetChildBox(); // reposition all our children while (child) { - nsRect childRect(child->GetRect()); + nsRect childRect(child->GetPhysicalRect()); childRect.x += (x - origX); childRect.y += (y - origY); child->SetBounds(aState, childRect); child = child->GetNextBox(); } } // Perform out-of-axis alignment for non-stretch alignments @@ -936,17 +936,17 @@ nsSprocketLayout::AlignChildren(nsIFrame halign = aBox->GetHAlign(); } nsIFrame* child = aBox->GetChildBox(); while (child) { nsMargin margin; child->GetMargin(margin); - nsRect childRect = child->GetRect(); + nsRect childRect = child->GetPhysicalRect(); if (isHorizontal) { const nscoord startAlign = clientRect.y + margin.top; const nscoord endAlign = clientRect.YMost() - margin.bottom - childRect.height; nscoord y; switch (valign) { @@ -988,17 +988,17 @@ nsSprocketLayout::AlignChildren(nsIFrame case nsBoxFrame::hAlign_Right: // end x = isLTR ? rightAlign : leftAlign; break; } childRect.x = x; } - if (childRect.TopLeft() != child->GetPosition()) { + if (childRect.TopLeft() != child->GetPhysicalPosition()) { child->SetBounds(aState, childRect); } child = child->GetNextBox(); } } void diff --git a/layout/xul/base/src/nsStackLayout.cpp b/layout/xul/base/src/nsStackLayout.cpp --- a/layout/xul/base/src/nsStackLayout.cpp +++ b/layout/xul/base/src/nsStackLayout.cpp @@ -271,17 +271,17 @@ nsStackLayout::Layout(nsIFrame* aBox, ns childRect.Deflate(margin); if (childRect.width < 0) childRect.width = 0; if (childRect.height < 0) childRect.height = 0; - nsRect oldRect(child->GetRect()); + nsRect oldRect(child->GetPhysicalRect()); bool sizeChanged = !oldRect.IsEqualEdges(childRect); // only lay out dirty children or children whose sizes have changed if (sizeChanged || NS_SUBTREE_DIRTY(child)) { // add in the child's margin nsMargin margin; child->GetMargin(margin); @@ -335,17 +335,17 @@ nsStackLayout::Layout(nsIFrame* aBox, ns // Now place the child. child->SetBounds(aState, childRect); // Flow the child. child->Layout(aState); // Get the child's new rect. - childRect = child->GetRect(); + childRect = child->GetPhysicalRect(); childRect.Inflate(margin); if (child->StyleXUL()->mStretchStack) { // Did the child push back on us and get bigger? if (offset.LeftRight() + childRect.width > clientRect.width) { clientRect.width = childRect.width + offset.LeftRight(); grow = true; } @@ -358,17 +358,17 @@ nsStackLayout::Layout(nsIFrame* aBox, ns } child = child->GetNextBox(); } } while (grow); // if some HTML inside us got bigger we need to force ourselves to // get bigger - nsRect bounds(aBox->GetRect()); + nsRect bounds(aBox->GetPhysicalRect()); nsMargin bp; aBox->GetBorderAndPadding(bp); clientRect.Inflate(bp); if (clientRect.width > bounds.width || clientRect.height > bounds.height) { if (clientRect.width > bounds.width) bounds.width = clientRect.width; diff --git a/layout/xul/base/src/nsTextBoxFrame.cpp b/layout/xul/base/src/nsTextBoxFrame.cpp --- a/layout/xul/base/src/nsTextBoxFrame.cpp +++ b/layout/xul/base/src/nsTextBoxFrame.cpp @@ -896,17 +896,17 @@ nsTextBoxFrame::DoLayout(nsBoxLayoutStat } nsresult rv = nsLeafBoxFrame::DoLayout(aBoxLayoutState); CalcDrawRect(*aBoxLayoutState.GetRenderingContext()); const nsStyleText* textStyle = StyleText(); - nsRect scrollBounds(nsPoint(0, 0), GetSize()); + nsRect scrollBounds(nsPoint(0, 0), GetPhysicalSize()); nsRect textRect = mTextDrawRect; nsRefPtr fontMet; nsLayoutUtils::GetFontMetricsForFrame(this, getter_AddRefs(fontMet)); nsBoundingMetrics metrics = fontMet->GetInkBoundsForVisualOverflow(mCroppedTitle.get(), mCroppedTitle.Length(), aBoxLayoutState.GetRenderingContext()); @@ -923,17 +923,17 @@ nsTextBoxFrame::DoLayout(nsBoxLayoutStat visualBounds.UnionRect(scrollBounds, textRect); nsOverflowAreas overflow(visualBounds, scrollBounds); if (textStyle->mTextShadow) { // text-shadow extends our visual but not scrollable bounds nsRect &vis = overflow.VisualOverflow(); vis.UnionRect(vis, nsLayoutUtils::GetTextShadowRectsUnion(mTextDrawRect, this)); } - FinishAndStoreOverflow(overflow, GetSize()); + FinishAndStoreOverflow(overflow, GetPhysicalSize()); return rv; } nsRect nsTextBoxFrame::GetComponentAlphaBounds() { if (StyleText()->mTextShadow) { @@ -986,17 +986,17 @@ nsTextBoxFrame::CalcTextSize(nsBoxLayout mNeedsRecalc = false; } } } void nsTextBoxFrame::CalcDrawRect(nsRenderingContext &aRenderingContext) { - nsRect textRect(nsPoint(0, 0), GetSize()); + nsRect textRect(nsPoint(0, 0), GetPhysicalSize()); nsMargin borderPadding; GetBorderAndPadding(borderPadding); textRect.Deflate(borderPadding); // determine (cropped) title and underline position nsPresContext* presContext = PresContext(); // determine (cropped) title which fits in aRect.width and its width nscoord titleWidth = diff --git a/layout/xul/tree/nsTreeBodyFrame.cpp b/layout/xul/tree/nsTreeBodyFrame.cpp --- a/layout/xul/tree/nsTreeBodyFrame.cpp +++ b/layout/xul/tree/nsTreeBodyFrame.cpp @@ -656,17 +656,17 @@ nsTreeBodyFrame::InvalidateColumn(nsITre return NS_ERROR_INVALID_ARG; #ifdef ACCESSIBILITY if (nsIPresShell::IsAccessibilityActive()) FireInvalidateEvent(-1, -1, aCol, aCol); #endif nsRect columnRect; - nsresult rv = col->GetRect(this, mInnerBox.y, mInnerBox.height, &columnRect); + nsresult rv = col->GetPhysicalRect(this, mInnerBox.y, mInnerBox.height, &columnRect); NS_ENSURE_SUCCESS(rv, rv); // When false then column is out of view if (OffsetForHorzScroll(columnRect, true)) InvalidateFrameWithRect(columnRect); return NS_OK; } @@ -707,17 +707,17 @@ nsTreeBodyFrame::InvalidateCell(int32_t if (aIndex < 0 || aIndex > mPageLength) return NS_OK; nsRefPtr col = GetColumnImpl(aCol); if (!col) return NS_ERROR_INVALID_ARG; nsRect cellRect; - nsresult rv = col->GetRect(this, mInnerBox.y+mRowHeight*aIndex, mRowHeight, + nsresult rv = col->GetPhysicalRect(this, mInnerBox.y+mRowHeight*aIndex, mRowHeight, &cellRect); NS_ENSURE_SUCCESS(rv, rv); if (OffsetForHorzScroll(cellRect, true)) InvalidateFrameWithRect(cellRect); return NS_OK; } @@ -782,17 +782,17 @@ nsTreeBodyFrame::InvalidateColumnRange(i if (nsIPresShell::IsAccessibilityActive()) { int32_t end = mRowCount > 0 ? ((mRowCount <= aEnd) ? mRowCount - 1 : aEnd) : 0; FireInvalidateEvent(aStart, end, aCol, aCol); } #endif nsRect rangeRect; - nsresult rv = col->GetRect(this, + nsresult rv = col->GetPhysicalRect(this, mInnerBox.y+mRowHeight*(aStart-mTopRowIndex), mRowHeight*(aEnd-aStart+1), &rangeRect); NS_ENSURE_SUCCESS(rv, rv); InvalidateFrameWithRect(rangeRect); return NS_OK; @@ -897,17 +897,17 @@ nsTreeBodyFrame::CheckOverflow(const Scr verticalOverflowChanged = true; } else if (mVerticalOverflow && mRowCount <= mPageLength) { mVerticalOverflow = false; verticalOverflowChanged = true; } if (aParts.mColumnsFrame) { - nsRect bounds = aParts.mColumnsFrame->GetRect(); + nsRect bounds = aParts.mColumnsFrame->GetPhysicalRect(); if (bounds.width != 0) { /* Ignore overflows that are less than half a pixel. Yes these happen all over the place when flex boxes are compressed real small. Probably a result of a rounding errors somewhere in the layout code. */ bounds.width += nsPresContext::CSSPixelsToAppUnits(0.5f); if (!mHorizontalOverflow && bounds.width < mHorzWidth) { mHorizontalOverflow = true; horizontalOverflowChanged = true; @@ -981,17 +981,17 @@ nsTreeBodyFrame::InvalidateScrollbars(co pageStr.AppendInt(pageincrement); aParts.mVScrollbarContent-> SetAttr(kNameSpaceID_None, nsGkAtoms::pageincrement, pageStr, true); ENSURE_TRUE(weakFrame.IsAlive()); } if (aParts.mHScrollbar && aParts.mColumnsFrame && aWeakColumnsFrame.IsAlive()) { // And now Horizontal scrollbar - nsRect bounds = aParts.mColumnsFrame->GetRect(); + nsRect bounds = aParts.mColumnsFrame->GetPhysicalRect(); nsAutoString maxposStr; maxposStr.AppendInt(mHorzWidth > bounds.width ? mHorzWidth - bounds.width : 0); aParts.mHScrollbarContent-> SetAttr(kNameSpaceID_None, nsGkAtoms::maxpos, maxposStr, true); ENSURE_TRUE(weakFrame.IsAlive()); nsAutoString pageStr; @@ -1641,17 +1641,17 @@ nsTreeBodyFrame::GetCellAt(nscoord aX, n *aRow = GetRowAt(aX, aY); if (*aRow < 0) return; // Determine the column hit. for (nsTreeColumn* currCol = mColumns->GetFirstColumn(); currCol; currCol = currCol->GetNext()) { nsRect cellRect; - nsresult rv = currCol->GetRect(this, + nsresult rv = currCol->GetPhysicalRect(this, mInnerBox.y + mRowHeight * (*aRow - mTopRowIndex), mRowHeight, &cellRect); if (NS_FAILED(rv)) { NS_NOTREACHED("column has no frame"); continue; } @@ -2493,17 +2493,17 @@ void nsTreeBodyFrame::CalcInnerBox() } nscoord nsTreeBodyFrame::CalcHorzWidth(const ScrollParts& aParts) { // Compute the adjustment to the last column. This varies depending on the // visibility of the columnpicker and the scrollbar. if (aParts.mColumnsFrame) - mAdjustWidth = mRect.width - aParts.mColumnsFrame->GetRect().width; + mAdjustWidth = mRect.width - aParts.mColumnsFrame->GetPhysicalRect().width; else mAdjustWidth = 0; nscoord width = 0; // We calculate this from the scrollable frame, so that it // properly covers all contingencies of what could be // scrollable (columns, body, etc...) @@ -2840,17 +2840,17 @@ nsTreeBodyFrame::PaintTreeBody(nsRenderi #endif // Loop through our columns and paint them (e.g., for sorting). This is only // relevant when painting backgrounds, since columns contain no content. Content // is contained in the rows. for (nsTreeColumn* currCol = mColumns->GetFirstColumn(); currCol; currCol = currCol->GetNext()) { nsRect colRect; - nsresult rv = currCol->GetRect(this, mInnerBox.y, mInnerBox.height, + nsresult rv = currCol->GetPhysicalRect(this, mInnerBox.y, mInnerBox.height, &colRect); // Don't paint hidden columns. if (NS_FAILED(rv) || colRect.width == 0) continue; if (OffsetForHorzScroll(colRect, false)) { nsRect dirtyRect; colRect += aPt; if (dirtyRect.IntersectRect(aDirtyRect, colRect)) { @@ -2985,17 +2985,17 @@ nsTreeBodyFrame::PaintRow(int32_t if (isSeparator) { // The row is a separator. nscoord primaryX = rowRect.x; nsTreeColumn* primaryCol = mColumns->GetPrimaryColumn(); if (primaryCol) { // Paint the primary cell. nsRect cellRect; - rv = primaryCol->GetRect(this, rowRect.y, rowRect.height, &cellRect); + rv = primaryCol->GetPhysicalRect(this, rowRect.y, rowRect.height, &cellRect); if (NS_FAILED(rv)) { NS_NOTREACHED("primary column is invalid"); return; } if (OffsetForHorzScroll(cellRect, false)) { cellRect.x += aPt.x; nsRect dirtyRect; @@ -3006,17 +3006,17 @@ nsTreeBodyFrame::PaintRow(int32_t aRenderingContext, aDirtyRect, primaryX, aPt); } // Paint the left side of the separator. nscoord currX; nsTreeColumn* previousCol = primaryCol->GetPrevious(); if (previousCol) { nsRect prevColRect; - rv = previousCol->GetRect(this, 0, 0, &prevColRect); + rv = previousCol->GetPhysicalRect(this, 0, 0, &prevColRect); if (NS_SUCCEEDED(rv)) { currX = (prevColRect.x - mHorzPosition) + prevColRect.width + aPt.x; } else { NS_NOTREACHED("The column before the primary column is invalid"); currX = rowRect.x; } } else { currX = rowRect.x; @@ -3042,17 +3042,17 @@ nsTreeBodyFrame::PaintRow(int32_t } PaintSeparator(aRowIndex, separatorRect, aPresContext, aRenderingContext, aDirtyRect); } else { // Now loop over our cells. Only paint a cell if it intersects with our dirty rect. for (nsTreeColumn* currCol = mColumns->GetFirstColumn(); currCol; currCol = currCol->GetNext()) { nsRect cellRect; - rv = currCol->GetRect(this, rowRect.y, rowRect.height, &cellRect); + rv = currCol->GetPhysicalRect(this, rowRect.y, rowRect.height, &cellRect); // Don't paint cells in hidden columns. if (NS_FAILED(rv) || cellRect.width == 0) continue; if (OffsetForHorzScroll(cellRect, false)) { cellRect.x += aPt.x; // for primary columns, use the row's vertical size so that the @@ -4139,17 +4139,17 @@ nsTreeBodyFrame::ScrollHorzInternal(cons return NS_OK; if (aPosition == mHorzPosition) return NS_OK; if (aPosition < 0 || aPosition > mHorzWidth) return NS_OK; - nsRect bounds = aParts.mColumnsFrame->GetRect(); + nsRect bounds = aParts.mColumnsFrame->GetPhysicalRect(); if (aPosition > (mHorzWidth - bounds.width)) aPosition = mHorzWidth - bounds.width; mHorzPosition = aPosition; Invalidate(); // Update the column scroll view diff --git a/layout/xul/tree/nsTreeColFrame.cpp b/layout/xul/tree/nsTreeColFrame.cpp --- a/layout/xul/tree/nsTreeColFrame.cpp +++ b/layout/xul/tree/nsTreeColFrame.cpp @@ -74,17 +74,17 @@ void nsDisplayXULTreeColSplitterTarget::HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect, HitTestState* aState, nsTArray *aOutFrames) { nsRect rect = aRect - ToReferenceFrame(); // If we are in either in the first 4 pixels or the last 4 pixels, we're going to // do something really strange. Check for an adjacent splitter. bool left = false; bool right = false; - if (mFrame->GetSize().width - nsPresContext::CSSPixelsToAppUnits(4) <= rect.XMost()) { + if (mFrame->GetPhysicalSize().width - nsPresContext::CSSPixelsToAppUnits(4) <= rect.XMost()) { right = true; } else if (nsPresContext::CSSPixelsToAppUnits(4) > rect.x) { left = true; } // Swap left and right for RTL trees in order to find the correct splitter if (mFrame->StyleVisibility()->mDirection == NS_STYLE_DIRECTION_RTL) { bool tmp = left; diff --git a/layout/xul/tree/nsTreeColumns.cpp b/layout/xul/tree/nsTreeColumns.cpp --- a/layout/xul/tree/nsTreeColumns.cpp +++ b/layout/xul/tree/nsTreeColumns.cpp @@ -85,39 +85,39 @@ nsTreeColumn::IsLastVisible(nsTreeBodyFr { NS_ASSERTION(GetFrame(), "should have checked for this already"); // cyclers are fixed width, don't adjust them if (IsCycler()) return false; // we're certainly not the last visible if we're not visible - if (GetFrame()->GetRect().width == 0) + if (GetFrame()->GetPhysicalRect().width == 0) return false; // try to find a visible successor for (nsTreeColumn *next = GetNext(); next; next = next->GetNext()) { nsIFrame* frame = next->GetFrame(); - if (frame && frame->GetRect().width > 0) + if (frame && frame->GetPhysicalRect().width > 0) return false; } return true; } nsresult -nsTreeColumn::GetRect(nsTreeBodyFrame* aBodyFrame, nscoord aY, nscoord aHeight, nsRect* aResult) +nsTreeColumn::GetPhysicalRect(nsTreeBodyFrame* aBodyFrame, nscoord aY, nscoord aHeight, nsRect* aResult) { nsIFrame* frame = GetFrame(); if (!frame) { *aResult = nsRect(); return NS_ERROR_FAILURE; } bool isRTL = aBodyFrame->StyleVisibility()->mDirection == NS_STYLE_DIRECTION_RTL; - *aResult = frame->GetRect(); + *aResult = frame->GetPhysicalRect(); aResult->y = aY; aResult->height = aHeight; if (isRTL) aResult->x += aBodyFrame->mAdjustWidth; else if (IsLastVisible(aBodyFrame)) aResult->width += aBodyFrame->mAdjustWidth; return NS_OK; } @@ -125,29 +125,29 @@ nsTreeColumn::GetRect(nsTreeBodyFrame* a nsresult nsTreeColumn::GetXInTwips(nsTreeBodyFrame* aBodyFrame, nscoord* aResult) { nsIFrame* frame = GetFrame(); if (!frame) { *aResult = 0; return NS_ERROR_FAILURE; } - *aResult = frame->GetRect().x; + *aResult = frame->GetPhysicalRect().x; return NS_OK; } nsresult nsTreeColumn::GetWidthInTwips(nsTreeBodyFrame* aBodyFrame, nscoord* aResult) { nsIFrame* frame = GetFrame(); if (!frame) { *aResult = 0; return NS_ERROR_FAILURE; } - *aResult = frame->GetRect().width; + *aResult = frame->GetPhysicalRect().width; if (IsLastVisible(aBodyFrame)) *aResult += aBodyFrame->mAdjustWidth; return NS_OK; } NS_IMETHODIMP nsTreeColumn::GetElement(nsIDOMElement** aElement) @@ -167,27 +167,27 @@ nsTreeColumn::GetColumns(nsITreeColumns* } NS_IMETHODIMP nsTreeColumn::GetX(int32_t* aX) { nsIFrame* frame = GetFrame(); NS_ENSURE_TRUE(frame, NS_ERROR_FAILURE); - *aX = nsPresContext::AppUnitsToIntCSSPixels(frame->GetRect().x); + *aX = nsPresContext::AppUnitsToIntCSSPixels(frame->GetPhysicalRect().x); return NS_OK; } NS_IMETHODIMP nsTreeColumn::GetWidth(int32_t* aWidth) { nsIFrame* frame = GetFrame(); NS_ENSURE_TRUE(frame, NS_ERROR_FAILURE); - *aWidth = nsPresContext::AppUnitsToIntCSSPixels(frame->GetRect().width); + *aWidth = nsPresContext::AppUnitsToIntCSSPixels(frame->GetPhysicalRect().width); return NS_OK; } NS_IMETHODIMP nsTreeColumn::GetId(nsAString& aId) { aId = GetId(); return NS_OK; diff --git a/layout/xul/tree/nsTreeColumns.h b/layout/xul/tree/nsTreeColumns.h --- a/layout/xul/tree/nsTreeColumns.h +++ b/layout/xul/tree/nsTreeColumns.h @@ -48,24 +48,24 @@ public: NS_DECL_NSITREECOLUMN friend class nsTreeBodyFrame; friend class nsTreeColumns; protected: nsIFrame* GetFrame(); nsIFrame* GetFrame(nsTreeBodyFrame* aBodyFrame); - // Don't call this if GetWidthInTwips or GetRect fails + // Don't call this if GetWidthInTwips or GetPhysicalRect fails bool IsLastVisible(nsTreeBodyFrame* aBodyFrame); /** * Returns a rect with x and width taken from the frame's rect and specified * y and height. May fail in case there's no frame for the column. */ - nsresult GetRect(nsTreeBodyFrame* aBodyFrame, nscoord aY, nscoord aHeight, + nsresult GetPhysicalRect(nsTreeBodyFrame* aBodyFrame, nscoord aY, nscoord aHeight, nsRect* aResult); nsresult GetXInTwips(nsTreeBodyFrame* aBodyFrame, nscoord* aResult); nsresult GetWidthInTwips(nsTreeBodyFrame* aBodyFrame, nscoord* aResult); void SetColumns(nsTreeColumns* aColumns) { mColumns = aColumns; } const nsAString& GetId() { return mId; } diff --git a/toolkit/components/typeaheadfind/nsTypeAheadFind.cpp b/toolkit/components/typeaheadfind/nsTypeAheadFind.cpp --- a/toolkit/components/typeaheadfind/nsTypeAheadFind.cpp +++ b/toolkit/components/typeaheadfind/nsTypeAheadFind.cpp @@ -1155,20 +1155,20 @@ nsTypeAheadFind::IsRangeVisible(nsIPresS nscoord minDistance = nsPresContext::CSSPixelsToAppUnits(kMinPixels); // Get the bounds of the current frame, relative to the current view. // We don't use the more accurate AccGetBounds, because that is // more expensive and the STATE_OFFSCREEN flag that this is used // for only needs to be a rough indicator nsRectVisibility rectVisibility = nsRectVisibility_kAboveViewport; - if (!aGetTopVisibleLeaf && !frame->GetRect().IsEmpty()) { + if (!aGetTopVisibleLeaf && !frame->GetPhysicalRect().IsEmpty()) { rectVisibility = aPresShell->GetRectVisibility(frame, - nsRect(nsPoint(0,0), frame->GetSize()), + nsRect(nsPoint(0,0), frame->GetPhysicalSize()), minDistance); if (rectVisibility != nsRectVisibility_kAboveViewport) { return true; } } // We know that the target range isn't usable because it's not in the @@ -1189,20 +1189,20 @@ nsTypeAheadFind::IsRangeVisible(nsIPresS return false; while (rectVisibility == nsRectVisibility_kAboveViewport) { frameTraversal->Next(); frame = frameTraversal->CurrentItem(); if (!frame) return false; - if (!frame->GetRect().IsEmpty()) { + if (!frame->GetPhysicalRect().IsEmpty()) { rectVisibility = aPresShell->GetRectVisibility(frame, - nsRect(nsPoint(0,0), frame->GetSize()), + nsRect(nsPoint(0,0), frame->GetPhysicalSize()), minDistance); } } if (frame) { nsCOMPtr firstVisibleNode = do_QueryInterface(frame->GetContent()); if (firstVisibleNode) { diff --git a/widget/android/nsAppShell.cpp b/widget/android/nsAppShell.cpp --- a/widget/android/nsAppShell.cpp +++ b/widget/android/nsAppShell.cpp @@ -504,17 +504,17 @@ nsAppShell::ProcessNextNativeEvent(bool } nsIntRect rect; int32_t colorDepth, pixelDepth; dom::ScreenOrientation orientation; nsCOMPtr screen; screenMgr->GetPrimaryScreen(getter_AddRefs(screen)); - screen->GetRect(&rect.x, &rect.y, &rect.width, &rect.height); + screen->GetPhysicalRect(&rect.x, &rect.y, &rect.width, &rect.height); screen->GetColorDepth(&colorDepth); screen->GetPixelDepth(&pixelDepth); orientation = static_cast(curEvent->ScreenOrientation()); hal::NotifyScreenConfigurationChange( hal::ScreenConfiguration(rect, orientation, colorDepth, pixelDepth)); break; diff --git a/widget/android/nsScreenManagerAndroid.cpp b/widget/android/nsScreenManagerAndroid.cpp --- a/widget/android/nsScreenManagerAndroid.cpp +++ b/widget/android/nsScreenManagerAndroid.cpp @@ -15,34 +15,34 @@ nsScreenAndroid::nsScreenAndroid(void *n { } nsScreenAndroid::~nsScreenAndroid() { } NS_IMETHODIMP -nsScreenAndroid::GetRect(int32_t *outLeft, int32_t *outTop, int32_t *outWidth, int32_t *outHeight) +nsScreenAndroid::GetPhysicalRect(int32_t *outLeft, int32_t *outTop, int32_t *outWidth, int32_t *outHeight) { gfxIntSize sz = nsWindow::GetAndroidScreenBounds(); *outLeft = 0; *outTop = 0; *outWidth = sz.width; *outHeight = sz.height; return NS_OK; } NS_IMETHODIMP nsScreenAndroid::GetAvailRect(int32_t *outLeft, int32_t *outTop, int32_t *outWidth, int32_t *outHeight) { - return GetRect(outLeft, outTop, outWidth, outHeight); + return GetPhysicalRect(outLeft, outTop, outWidth, outHeight); } NS_IMETHODIMP nsScreenAndroid::GetPixelDepth(int32_t *aPixelDepth) { *aPixelDepth = AndroidBridge::Bridge()->GetScreenDepth(); diff --git a/widget/android/nsScreenManagerAndroid.h b/widget/android/nsScreenManagerAndroid.h --- a/widget/android/nsScreenManagerAndroid.h +++ b/widget/android/nsScreenManagerAndroid.h @@ -13,17 +13,17 @@ #include "WidgetUtils.h" class nsScreenAndroid MOZ_FINAL : public nsBaseScreen { public: nsScreenAndroid(void *nativeScreen); ~nsScreenAndroid(); - NS_IMETHOD GetRect(int32_t* aLeft, int32_t* aTop, int32_t* aWidth, int32_t* aHeight); + NS_IMETHOD GetPhysicalRect(int32_t* aLeft, int32_t* aTop, int32_t* aWidth, int32_t* aHeight); NS_IMETHOD GetAvailRect(int32_t* aLeft, int32_t* aTop, int32_t* aWidth, int32_t* aHeight); NS_IMETHOD GetPixelDepth(int32_t* aPixelDepth); NS_IMETHOD GetColorDepth(int32_t* aColorDepth); protected: virtual void ApplyMinimumBrightness(uint32_t aBrightness) MOZ_OVERRIDE; }; diff --git a/widget/gonk/Framebuffer.cpp b/widget/gonk/Framebuffer.cpp --- a/widget/gonk/Framebuffer.cpp +++ b/widget/gonk/Framebuffer.cpp @@ -126,17 +126,17 @@ Open() // Clear the framebuffer to a known state. Present(nsIntRect()); return true; } bool -GetSize(nsIntSize *aScreenSize) { +GetPhysicalSize(nsIntSize *aScreenSize) { // If the framebuffer has been opened, we should always have the size. if (sScreenSize) { *aScreenSize = *sScreenSize; return true; } ScopedClose fd(open("/dev/graphics/fb0", O_RDWR)); if (0 > fd.get()) { diff --git a/widget/gonk/Framebuffer.h b/widget/gonk/Framebuffer.h --- a/widget/gonk/Framebuffer.h +++ b/widget/gonk/Framebuffer.h @@ -43,17 +43,17 @@ bool Open(); // After Close(), the result of all further calls is undefined. // Close() is idempotent, and Open() can be called again after // Close(). void Close(); // Return true if the fbdev was successfully opened or the size was // already cached. -bool GetSize(nsIntSize *aScreenSize); +bool GetPhysicalSize(nsIntSize *aScreenSize); // Return the buffer to be drawn into, that will be the next frame. gfxASurface* BackBuffer(); // Swap the front buffer for the back buffer. |aUpdated| is the // region of the back buffer that was repainted. void Present(const nsIntRegion& aUpdated); diff --git a/widget/gonk/HwcComposer2D.cpp b/widget/gonk/HwcComposer2D.cpp --- a/widget/gonk/HwcComposer2D.cpp +++ b/widget/gonk/HwcComposer2D.cpp @@ -76,17 +76,17 @@ HwcComposer2D::Init(hwc_display_t dpy, h mHwc = (HwcDevice*)GetGonkDisplay()->GetHWCDevice(); if (!mHwc) { LOGE("Failed to initialize hwc"); return -1; } nsIntSize screenSize; - mozilla::Framebuffer::GetSize(&screenSize); + mozilla::Framebuffer::GetPhysicalSize(&screenSize); mScreenRect = nsIntRect(nsIntPoint(0, 0), screenSize); char propValue[PROPERTY_VALUE_MAX]; property_get("ro.display.colorfill", propValue, "0"); mColorFill = (atoi(propValue) == 1) ? true : false; mDpy = dpy; mSur = sur; diff --git a/widget/gonk/OrientationObserver.cpp b/widget/gonk/OrientationObserver.cpp --- a/widget/gonk/OrientationObserver.cpp +++ b/widget/gonk/OrientationObserver.cpp @@ -63,17 +63,17 @@ static void DetectDefaultOrientation() { nsCOMPtr screen = GetPrimaryScreen(); if (!screen) { return; } int32_t left, top, width, height; - if (NS_FAILED(screen->GetRect(&left, &top, &width, &height))) { + if (NS_FAILED(screen->GetPhysicalRect(&left, &top, &width, &height))) { return; } uint32_t rotation; if (NS_FAILED(screen->GetRotation(&rotation))) { return; } diff --git a/widget/gonk/libdisplay/BootAnimation.cpp b/widget/gonk/libdisplay/BootAnimation.cpp --- a/widget/gonk/libdisplay/BootAnimation.cpp +++ b/widget/gonk/libdisplay/BootAnimation.cpp @@ -54,17 +54,17 @@ struct local_file_header { uint16_t extra_field_size; char data[0]; uint32_t GetDataSize() const { return letoh32(uncompressed_size); } - uint32_t GetSize() const + uint32_t GetPhysicalSize() const { /* XXX account for data descriptor */ return sizeof(local_file_header) + letoh16(filename_size) + letoh16(extra_field_size) + GetDataSize(); } const char * GetData() const { @@ -98,17 +98,17 @@ struct cdir_entry { uint32_t offset; char data[0]; uint32_t GetDataSize() const { return letoh32(compressed_size); } - uint32_t GetSize() const + uint32_t GetPhysicalSize() const { return sizeof(cdir_entry) + letoh16(filename_size) + letoh16(extra_field_size) + letoh16(file_comment_size); } bool Valid() const { return signature == htole32(0x02014b50); @@ -189,21 +189,21 @@ public: return true; } /* Pass null to get the first cdir entry */ const cdir_entry * GetNextEntry(const cdir_entry *prev) { const cdir_entry *entry; if (prev) - entry = (cdir_entry *)((char *)prev + prev->GetSize()); + entry = (cdir_entry *)((char *)prev + prev->GetPhysicalSize()); else entry = (cdir_entry *)(mBuf + letoh32(mEnd->cdir_offset)); - if (((char *)entry + entry->GetSize()) > mCdir_limit || + if (((char *)entry + entry->GetPhysicalSize()) > mCdir_limit || !entry->Valid()) return nullptr; return entry; } string GetEntryName(const cdir_entry *entry) { uint16_t len = letoh16(entry->filename_size); @@ -212,17 +212,17 @@ public: name.append(entry->data, len); return name; } const local_file_header * GetLocalEntry(const cdir_entry *entry) { const local_file_header * data = (local_file_header *)(mBuf + letoh32(entry->offset)); - if (((char *)data + data->GetSize()) > (char *)mEnd) + if (((char *)data + data->GetPhysicalSize()) > (char *)mEnd) return nullptr; return data; } }; struct AnimationFrame { char path[256]; char *buf; diff --git a/widget/gonk/nsScreenManagerGonk.h b/widget/gonk/nsScreenManagerGonk.h --- a/widget/gonk/nsScreenManagerGonk.h +++ b/widget/gonk/nsScreenManagerGonk.h @@ -26,17 +26,17 @@ class nsScreenGonk : public nsBaseScreen { typedef mozilla::hal::ScreenConfiguration ScreenConfiguration; public: nsScreenGonk(void* nativeScreen); ~nsScreenGonk(); - NS_IMETHOD GetRect(int32_t* aLeft, int32_t* aTop, int32_t* aWidth, int32_t* aHeight); + NS_IMETHOD GetPhysicalRect(int32_t* aLeft, int32_t* aTop, int32_t* aWidth, int32_t* aHeight); NS_IMETHOD GetAvailRect(int32_t* aLeft, int32_t* aTop, int32_t* aWidth, int32_t* aHeight); NS_IMETHOD GetPixelDepth(int32_t* aPixelDepth); NS_IMETHOD GetColorDepth(int32_t* aColorDepth); NS_IMETHOD GetRotation(uint32_t* aRotation); NS_IMETHOD SetRotation(uint32_t aRotation); static uint32_t GetRotation(); static ScreenConfiguration GetConfiguration(); diff --git a/widget/gonk/nsWindow.cpp b/widget/gonk/nsWindow.cpp --- a/widget/gonk/nsWindow.cpp +++ b/widget/gonk/nsWindow.cpp @@ -130,17 +130,17 @@ nsWindow::nsWindow() if (!sScreenInitialized) { sScreenOnEvent = new ScreenOnOffEvent(true); ClearOnShutdown(&sScreenOnEvent); sScreenOffEvent = new ScreenOnOffEvent(false); ClearOnShutdown(&sScreenOffEvent); GetGonkDisplay()->OnEnabled(displayEnabledCallback); nsIntSize screenSize; - bool gotFB = Framebuffer::GetSize(&screenSize); + bool gotFB = Framebuffer::GetPhysicalSize(&screenSize); if (!gotFB) { NS_RUNTIMEABORT("Failed to get size from framebuffer, aborting..."); } gScreenBounds = nsIntRect(nsIntPoint(0, 0), screenSize); char propValue[PROPERTY_VALUE_MAX]; property_get("ro.sf.hwrotation", propValue, "0"); sPhysicalScreenRotation = atoi(propValue) / 90; @@ -714,33 +714,33 @@ nsScreenGonk::nsScreenGonk(void *nativeS { } nsScreenGonk::~nsScreenGonk() { } NS_IMETHODIMP -nsScreenGonk::GetRect(int32_t *outLeft, int32_t *outTop, +nsScreenGonk::GetPhysicalRect(int32_t *outLeft, int32_t *outTop, int32_t *outWidth, int32_t *outHeight) { *outLeft = sVirtualBounds.x; *outTop = sVirtualBounds.y; *outWidth = sVirtualBounds.width; *outHeight = sVirtualBounds.height; return NS_OK; } NS_IMETHODIMP nsScreenGonk::GetAvailRect(int32_t *outLeft, int32_t *outTop, int32_t *outWidth, int32_t *outHeight) { - return GetRect(outLeft, outTop, outWidth, outHeight); + return GetPhysicalRect(outLeft, outTop, outWidth, outHeight); } static uint32_t ColorDepth() { switch (GetGonkDisplay()->surfaceformat) { case GGL_PIXEL_FORMAT_RGB_565: return 16; diff --git a/widget/gtk2/nsNativeThemeGTK.cpp b/widget/gtk2/nsNativeThemeGTK.cpp --- a/widget/gtk2/nsNativeThemeGTK.cpp +++ b/widget/gtk2/nsNativeThemeGTK.cpp @@ -141,18 +141,18 @@ static GtkTextDirection GetTextDirection return GTK_TEXT_DIR_NONE; } // Returns positive for negative margins (otherwise 0). gint nsNativeThemeGTK::GetTabMarginPixels(nsIFrame* aFrame) { nscoord margin = - IsBottomTab(aFrame) ? aFrame->GetUsedMargin().top - : aFrame->GetUsedMargin().bottom; + IsBottomTab(aFrame) ? aFrame->GetUsedPhysicalMargin().top + : aFrame->GetUsedPhysicalMargin().bottom; return std::min(MOZ_GTK_TAB_MARGIN_MASK, std::max(0, aFrame->PresContext()->AppUnitsToDevPixels(-margin))); } bool nsNativeThemeGTK::GetGtkWidgetAndState(uint8_t aWidgetType, nsIFrame* aFrame, @@ -1084,17 +1084,17 @@ nsNativeThemeGTK::GetMinimumWidgetSize(n } break; case NS_THEME_SCROLLBAR_THUMB_VERTICAL: case NS_THEME_SCROLLBAR_THUMB_HORIZONTAL: { MozGtkScrollbarMetrics metrics; moz_gtk_get_scrollbar_metrics(&metrics); - nsRect rect = aFrame->GetParent()->GetRect(); + nsRect rect = aFrame->GetParent()->GetPhysicalRect(); int32_t p2a = aFrame->PresContext()->DeviceContext()-> AppUnitsPerDevPixel(); nsMargin margin; /* Get the available space, if that is smaller then the minimum size, * adjust the mininum size to fit into it. * Setting aIsOverridable to true has no effect for thumbs. */ aFrame->GetMargin(margin); diff --git a/widget/gtk2/nsScreenGtk.cpp b/widget/gtk2/nsScreenGtk.cpp --- a/widget/gtk2/nsScreenGtk.cpp +++ b/widget/gtk2/nsScreenGtk.cpp @@ -21,26 +21,26 @@ nsScreenGtk :: nsScreenGtk ( ) nsScreenGtk :: ~nsScreenGtk() { } NS_IMETHODIMP -nsScreenGtk :: GetRect(int32_t *outLeft, int32_t *outTop, int32_t *outWidth, int32_t *outHeight) +nsScreenGtk :: GetPhysicalRect(int32_t *outLeft, int32_t *outTop, int32_t *outWidth, int32_t *outHeight) { *outLeft = mRect.x; *outTop = mRect.y; *outWidth = mRect.width; *outHeight = mRect.height; return NS_OK; -} // GetRect +} // GetPhysicalRect NS_IMETHODIMP nsScreenGtk :: GetAvailRect(int32_t *outLeft, int32_t *outTop, int32_t *outWidth, int32_t *outHeight) { *outLeft = mAvailRect.x; *outTop = mAvailRect.y; *outWidth = mAvailRect.width; diff --git a/widget/gtk2/nsScreenGtk.h b/widget/gtk2/nsScreenGtk.h --- a/widget/gtk2/nsScreenGtk.h +++ b/widget/gtk2/nsScreenGtk.h @@ -25,17 +25,17 @@ typedef struct { //------------------------------------------------------------------------ class nsScreenGtk : public nsBaseScreen { public: nsScreenGtk(); ~nsScreenGtk(); - NS_IMETHOD GetRect(int32_t* aLeft, int32_t* aTop, int32_t* aWidth, int32_t* aHeight); + NS_IMETHOD GetPhysicalRect(int32_t* aLeft, int32_t* aTop, int32_t* aWidth, int32_t* aHeight); NS_IMETHOD GetAvailRect(int32_t* aLeft, int32_t* aTop, int32_t* aWidth, int32_t* aHeight); NS_IMETHOD GetPixelDepth(int32_t* aPixelDepth); NS_IMETHOD GetColorDepth(int32_t* aColorDepth); void Init(GdkWindow *aRootWindow); #ifdef MOZ_X11 void Init(XineramaScreenInfo *aScreenInfo); #endif /* MOZ_X11 */ diff --git a/widget/gtk2/nsScreenManagerGtk.cpp b/widget/gtk2/nsScreenManagerGtk.cpp --- a/widget/gtk2/nsScreenManagerGtk.cpp +++ b/widget/gtk2/nsScreenManagerGtk.cpp @@ -216,17 +216,17 @@ nsScreenManagerGtk :: ScreenForRect ( in if (mCachedScreenArray.Count() > 1) { // walk the list of screens and find the one that has the most // surface area. uint32_t area = 0; nsIntRect windowRect(aX, aY, aWidth, aHeight); for (int32_t i = 0, i_end = mCachedScreenArray.Count(); i < i_end; ++i) { int32_t x, y, width, height; x = y = width = height = 0; - mCachedScreenArray[i]->GetRect(&x, &y, &width, &height); + mCachedScreenArray[i]->GetPhysicalRect(&x, &y, &width, &height); // calculate the surface area nsIntRect screenRect(x, y, width, height); screenRect.IntersectRect(screenRect, windowRect); uint32_t tempArea = screenRect.width * screenRect.height; if (tempArea >= area) { which = i; area = tempArea; } diff --git a/widget/gtk2/nsWindow.cpp b/widget/gtk2/nsWindow.cpp --- a/widget/gtk2/nsWindow.cpp +++ b/widget/gtk2/nsWindow.cpp @@ -5955,17 +5955,17 @@ nsWindow::GetSurfaceForGdkDrawable(GdkDr TemporaryRef nsWindow::StartRemoteDrawing() { gfxASurface *surf = GetThebesSurface(); if (!surf) { return nullptr; } - IntSize size(surf->GetSize().width, surf->GetSize().height); + IntSize size(surf->GetPhysicalSize().width, surf->GetPhysicalSize().height); if (size.width <= 0 || size.height <= 0) { return nullptr; } return gfxPlatform::GetPlatform()->CreateDrawTargetForSurface(surf, size); } #endif diff --git a/widget/os2/nsScreenOS2.cpp b/widget/os2/nsScreenOS2.cpp --- a/widget/os2/nsScreenOS2.cpp +++ b/widget/os2/nsScreenOS2.cpp @@ -15,43 +15,43 @@ nsScreenOS2 :: nsScreenOS2 ( ) nsScreenOS2 :: ~nsScreenOS2() { // nothing to see here. } NS_IMETHODIMP -nsScreenOS2 :: GetRect(int32_t *outLeft, int32_t *outTop, int32_t *outWidth, int32_t *outHeight) +nsScreenOS2 :: GetPhysicalRect(int32_t *outLeft, int32_t *outTop, int32_t *outWidth, int32_t *outHeight) { LONG alArray[2]; HPS hps = ::WinGetScreenPS( HWND_DESKTOP); HDC hdc = ::GpiQueryDevice (hps); ::DevQueryCaps(hdc, CAPS_WIDTH, 2, alArray); ::WinReleasePS(hps); *outTop = 0; *outLeft = 0; *outWidth = alArray[0]; *outHeight = alArray[1]; return NS_OK; -} // GetRect +} // GetPhysicalRect NS_IMETHODIMP nsScreenOS2 :: GetAvailRect(int32_t *outLeft, int32_t *outTop, int32_t *outWidth, int32_t *outHeight) { static APIRET rc = 0; static BOOL (APIENTRY * pfnQueryDesktopWorkArea)(HWND hwndDesktop, PWRECT pwrcWorkArea) = NULL; - GetRect(outLeft, outTop, outWidth, outHeight); + GetPhysicalRect(outLeft, outTop, outWidth, outHeight); // This height is different based on whether or not // "Show on top of maximed windows" is checked LONG lWorkAreaHeight = *outHeight; if ( !rc && !pfnQueryDesktopWorkArea ) { HMODULE hmod = 0; diff --git a/widget/os2/nsScreenOS2.h b/widget/os2/nsScreenOS2.h --- a/widget/os2/nsScreenOS2.h +++ b/widget/os2/nsScreenOS2.h @@ -15,17 +15,17 @@ //------------------------------------------------------------------------ class nsScreenOS2 : public nsBaseScreen { public: nsScreenOS2 ( ); virtual ~nsScreenOS2(); - NS_IMETHOD GetRect(int32_t* aLeft, int32_t* aTop, int32_t* aWidth, int32_t* aHeight); + NS_IMETHOD GetPhysicalRect(int32_t* aLeft, int32_t* aTop, int32_t* aWidth, int32_t* aHeight); NS_IMETHOD GetAvailRect(int32_t* aLeft, int32_t* aTop, int32_t* aWidth, int32_t* aHeight); NS_IMETHOD GetPixelDepth(int32_t* aPixelDepth); NS_IMETHOD GetColorDepth(int32_t* aColorDepth); private: }; diff --git a/widget/qt/mozqglwidgetwrapper.cpp b/widget/qt/mozqglwidgetwrapper.cpp --- a/widget/qt/mozqglwidgetwrapper.cpp +++ b/widget/qt/mozqglwidgetwrapper.cpp @@ -33,9 +33,9 @@ bool MozQGLWidgetWrapper::hasGLContext(Q { return aView && qobject_cast(aView->viewport()); } bool MozQGLWidgetWrapper::isRGBAContext() { QGLContext* context = const_cast(QGLContext::currentContext()); return context && context->format().alpha(); -} \ No newline at end of file +} diff --git a/widget/qt/nsNativeThemeQt.cpp b/widget/qt/nsNativeThemeQt.cpp --- a/widget/qt/nsNativeThemeQt.cpp +++ b/widget/qt/nsNativeThemeQt.cpp @@ -355,17 +355,17 @@ nsNativeThemeQt::GetMinimumWidgetSize(ns QStyle *s = qApp->style(); int32_t p2a = aContext->AppUnitsPerDevPixel(); switch (aWidgetType) { case NS_THEME_RADIO: case NS_THEME_CHECKBOX: { - nsRect frameRect = aFrame->GetRect(); + nsRect frameRect = aFrame->GetPhysicalRect(); QRect qRect = qRectInPixels(frameRect, p2a); QStyleOptionButton option; InitButtonStyle(aWidgetType, aFrame, qRect, option); QRect rect = s->subElementRect( @@ -375,17 +375,17 @@ nsNativeThemeQt::GetMinimumWidgetSize(ns &option, NULL); (*aResult).width = rect.width(); (*aResult).height = rect.height(); break; } case NS_THEME_BUTTON: { - nsRect frameRect = aFrame->GetRect(); + nsRect frameRect = aFrame->GetPhysicalRect(); QRect qRect = qRectInPixels(frameRect, p2a); QStyleOptionButton option; InitButtonStyle(aWidgetType, aFrame, qRect, option); QRect rect = s->subElementRect( @@ -431,33 +431,33 @@ nsNativeThemeQt::GetMinimumWidgetSize(ns case NS_THEME_SCROLLBAR_TRACK_HORIZONTAL: { (*aResult).width = s->pixelMetric(QStyle::PM_SliderLength); (*aResult).height = s->pixelMetric(QStyle::PM_ScrollBarExtent); break; } case NS_THEME_DROPDOWN_BUTTON: { QStyleOptionComboBox comboOpt; - nsRect frameRect = aFrame->GetRect(); + nsRect frameRect = aFrame->GetPhysicalRect(); QRect qRect = qRectInPixels(frameRect, p2a); comboOpt.rect = qRect; InitComboStyle(aWidgetType, aFrame, qRect, comboOpt); QRect subRect = s->subControlRect(QStyle::CC_ComboBox, &comboOpt, QStyle::SC_ComboBoxArrow, NULL); (*aResult).width = subRect.width(); (*aResult).height = subRect.height(); //*aIsOverridable = false; break; } case NS_THEME_DROPDOWN: { QStyleOptionComboBox comboOpt; - nsRect frameRect = aFrame->GetRect(); + nsRect frameRect = aFrame->GetPhysicalRect(); QRect qRect = qRectInPixels(frameRect, p2a); comboOpt.rect = qRect; InitComboStyle(aWidgetType, aFrame, qRect, comboOpt); QRect subRect = s->subControlRect(QStyle::CC_ComboBox, &comboOpt, QStyle::SC_ComboBoxFrame, @@ -466,33 +466,33 @@ nsNativeThemeQt::GetMinimumWidgetSize(ns (*aResult).width = subRect.width(); (*aResult).height = subRect.height(); //*aIsOverridable = false; break; } case NS_THEME_DROPDOWN_TEXT: { QStyleOptionComboBox comboOpt; - nsRect frameRect = aFrame->GetRect(); + nsRect frameRect = aFrame->GetPhysicalRect(); QRect qRect = qRectInPixels(frameRect, p2a); comboOpt.rect = qRect; QRect subRect = s->subControlRect(QStyle::CC_ComboBox, &comboOpt, QStyle::SC_ComboBoxEditField, NULL); (*aResult).width = subRect.width(); (*aResult).height = subRect.height(); //*aIsOverridable = false; break; } case NS_THEME_DROPDOWN_TEXTFIELD: { QStyleOptionComboBox comboOpt; - nsRect frameRect = aFrame->GetRect(); + nsRect frameRect = aFrame->GetPhysicalRect(); QRect qRect = qRectInPixels(frameRect, p2a); comboOpt.rect = qRect; QRect subRect = s->subControlRect(QStyle::CC_ComboBox, &comboOpt, QStyle::SC_ComboBoxArrow, NULL); QRect subRect2 = s->subControlRect(QStyle::CC_ComboBox, &comboOpt, QStyle::SC_ComboBoxFrame, NULL); diff --git a/widget/qt/nsScreenQt.cpp b/widget/qt/nsScreenQt.cpp --- a/widget/qt/nsScreenQt.cpp +++ b/widget/qt/nsScreenQt.cpp @@ -40,17 +40,17 @@ nsScreenQt::~nsScreenQt() { #ifdef MOZ_ENABLE_QMSYSTEM2 delete mDisplayState; mDisplayState = nullptr; #endif } NS_IMETHODIMP -nsScreenQt::GetRect(int32_t *outLeft,int32_t *outTop, +nsScreenQt::GetPhysicalRect(int32_t *outLeft,int32_t *outTop, int32_t *outWidth,int32_t *outHeight) { QRect r = QApplication::desktop()->screenGeometry(mScreen); #ifdef MOZ_ENABLE_QTMOBILITY r = MozQOrientationSensorFilter::GetRotationTransform().mapRect(r); // just rotating gives us weird negative coordinates, but we want to return // sensible logical coordinates r.moveTo(0, 0); diff --git a/widget/qt/nsScreenQt.h b/widget/qt/nsScreenQt.h --- a/widget/qt/nsScreenQt.h +++ b/widget/qt/nsScreenQt.h @@ -19,17 +19,17 @@ namespace MeeGo //------------------------------------------------------------------------ class nsScreenQt : public nsBaseScreen { public: nsScreenQt (int aScreen); virtual ~nsScreenQt(); - NS_IMETHOD GetRect(int32_t* aLeft, int32_t* aTop, int32_t* aWidth, int32_t* aHeight); + NS_IMETHOD GetPhysicalRect(int32_t* aLeft, int32_t* aTop, int32_t* aWidth, int32_t* aHeight); NS_IMETHOD GetAvailRect(int32_t* aLeft, int32_t* aTop, int32_t* aWidth, int32_t* aHeight); NS_IMETHOD GetPixelDepth(int32_t* aPixelDepth); NS_IMETHOD GetColorDepth(int32_t* aColorDepth); #ifdef MOZ_ENABLE_QMSYSTEM2 protected: virtual void ApplyMinimumBrightness(uint32_t aType) MOZ_OVERRIDE; private: diff --git a/widget/windows/WinMouseScrollHandler.h b/widget/windows/WinMouseScrollHandler.h --- a/widget/windows/WinMouseScrollHandler.h +++ b/widget/windows/WinMouseScrollHandler.h @@ -511,9 +511,9 @@ public: static bool sFakeScrollableWindowNeeded; }; // class Device }; } // namespace widget } // namespace mozilla -#endif // mozilla_widget_WinMouseScrollHandler_h__ \ No newline at end of file +#endif // mozilla_widget_WinMouseScrollHandler_h__ diff --git a/widget/windows/WinUtils.cpp b/widget/windows/WinUtils.cpp --- a/widget/windows/WinUtils.cpp +++ b/widget/windows/WinUtils.cpp @@ -650,17 +650,17 @@ AsyncFaviconDataReady::OnComplete(nsIURI context.SetOperator(gfxContext::OPERATOR_SOURCE); context.SetColor(gfxRGBA(1, 1, 1, 1)); context.Rectangle(gfxRect(0, 0, 48, 48)); context.Fill(); context.Translate(gfxPoint(16, 16)); context.SetOperator(gfxContext::OPERATOR_OVER); context.DrawSurface(imgFrame, gfxSize(16, 16)); - size = imageSurface->GetSize(); + size = imageSurface->GetPhysicalSize(); } else { imageSurface = imgFrame->GetAsReadableARGB32ImageSurface(); size.width = GetSystemMetrics(SM_CXSMICON); size.height = GetSystemMetrics(SM_CYSMICON); if (!size.width || !size.height) { size.width = 16; size.height = 16; } diff --git a/widget/windows/nsScreenWin.cpp b/widget/windows/nsScreenWin.cpp --- a/widget/windows/nsScreenWin.cpp +++ b/widget/windows/nsScreenWin.cpp @@ -27,17 +27,17 @@ nsScreenWin :: nsScreenWin ( HMONITOR in nsScreenWin :: ~nsScreenWin() { // nothing to see here. } NS_IMETHODIMP -nsScreenWin :: GetRect(int32_t *outLeft, int32_t *outTop, int32_t *outWidth, int32_t *outHeight) +nsScreenWin :: GetPhysicalRect(int32_t *outLeft, int32_t *outTop, int32_t *outWidth, int32_t *outHeight) { BOOL success = FALSE; if ( mScreen ) { MONITORINFO info; info.cbSize = sizeof(MONITORINFO); success = ::GetMonitorInfoW( mScreen, &info ); if ( success ) { *outLeft = info.rcMonitor.left; @@ -53,17 +53,17 @@ nsScreenWin :: GetRect(int32_t *outLeft, *outTop = *outLeft = 0; *outWidth = ::GetDeviceCaps(hDCScreen, HORZRES); *outHeight = ::GetDeviceCaps(hDCScreen, VERTRES); ::ReleaseDC(nullptr, hDCScreen); } return NS_OK; -} // GetRect +} // GetPhysicalRect NS_IMETHODIMP nsScreenWin :: GetAvailRect(int32_t *outLeft, int32_t *outTop, int32_t *outWidth, int32_t *outHeight) { BOOL success = FALSE; if ( mScreen ) { @@ -100,17 +100,17 @@ GetDPIScale() return dpiScale; } NS_IMETHODIMP nsScreenWin::GetRectDisplayPix(int32_t *outLeft, int32_t *outTop, int32_t *outWidth, int32_t *outHeight) { int32_t left, top, width, height; - nsresult rv = GetRect(&left, &top, &width, &height); + nsresult rv = GetPhysicalRect(&left, &top, &width, &height); if (NS_FAILED(rv)) { return rv; } double scaleFactor = 1.0 / GetDPIScale(); *outLeft = NSToIntRound(left * scaleFactor); *outTop = NSToIntRound(top * scaleFactor); *outWidth = NSToIntRound(width * scaleFactor); *outHeight = NSToIntRound(height * scaleFactor); diff --git a/widget/windows/nsScreenWin.h b/widget/windows/nsScreenWin.h --- a/widget/windows/nsScreenWin.h +++ b/widget/windows/nsScreenWin.h @@ -13,17 +13,17 @@ class nsScreenWin : public nsBaseScreen { public: nsScreenWin ( HMONITOR inScreen ); ~nsScreenWin(); // These methods return the size in device (physical) pixels - NS_IMETHOD GetRect(int32_t* aLeft, int32_t* aTop, int32_t* aWidth, int32_t* aHeight); + NS_IMETHOD GetPhysicalRect(int32_t* aLeft, int32_t* aTop, int32_t* aWidth, int32_t* aHeight); NS_IMETHOD GetAvailRect(int32_t* aLeft, int32_t* aTop, int32_t* aWidth, int32_t* aHeight); // And these methods get the screen size in 'display pixels' (AKA 'logical pixels') // that are dependent on the logical DPI setting in windows NS_IMETHOD GetRectDisplayPix(int32_t *outLeft, int32_t *outTop, int32_t *outWidth, int32_t *outHeight); NS_IMETHOD GetAvailRectDisplayPix(int32_t *outLeft, int32_t *outTop, int32_t *outWidth, int32_t *outHeight); diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp --- a/widget/windows/nsWindow.cpp +++ b/widget/windows/nsWindow.cpp @@ -3543,17 +3543,17 @@ nsWindow::StartRemoteDrawing() if (!dc) { return nullptr; } uint32_t flags = (mTransparencyMode == eTransparencyOpaque) ? 0 : gfxWindowsSurface::FLAG_IS_TRANSPARENT; nsRefPtr surf = new gfxWindowsSurface(dc, flags); - mozilla::gfx::IntSize size(surf->GetSize().width, surf->GetSize().height); + mozilla::gfx::IntSize size(surf->GetPhysicalSize().width, surf->GetPhysicalSize().height); if (size.width <= 0 || size.height <= 0) { ReleaseDC(mWnd, dc); return nullptr; } MOZ_ASSERT(!mCompositeDC); mCompositeDC = dc; diff --git a/widget/windows/nsWindowGfx.cpp b/widget/windows/nsWindowGfx.cpp --- a/widget/windows/nsWindowGfx.cpp +++ b/widget/windows/nsWindowGfx.cpp @@ -436,17 +436,17 @@ bool nsWindow::OnPaint(HDC aDC, uint32_t mD2DWindowSurface->Present(); } } #endif if (result) { if (IsRenderMode(gfxWindowsPlatform::RENDER_IMAGE_STRETCH24) || IsRenderMode(gfxWindowsPlatform::RENDER_IMAGE_STRETCH32)) { - gfxIntSize surfaceSize = targetSurfaceImage->GetSize(); + gfxIntSize surfaceSize = targetSurfaceImage->GetPhysicalSize(); // Just blit this directly BITMAPINFOHEADER bi; memset(&bi, 0, sizeof(BITMAPINFOHEADER)); bi.biSize = sizeof(BITMAPINFOHEADER); bi.biWidth = surfaceSize.width; bi.biHeight = - surfaceSize.height; bi.biPlanes = 1; diff --git a/widget/windows/winrt/APZController.cpp b/widget/windows/winrt/APZController.cpp --- a/widget/windows/winrt/APZController.cpp +++ b/widget/windows/winrt/APZController.cpp @@ -99,9 +99,9 @@ APZController::HandlePanBegin() } void APZController::HandlePanEnd() { MetroUtils::FireObserver("apzc-handle-pan-end", L""); } -} } } \ No newline at end of file +} } } diff --git a/widget/windows/winrt/APZController.h b/widget/windows/winrt/APZController.h --- a/widget/windows/winrt/APZController.h +++ b/widget/windows/winrt/APZController.h @@ -24,9 +24,9 @@ public: virtual void HandleSingleTap(const mozilla::CSSIntPoint& aPoint); virtual void HandleLongTap(const mozilla::CSSIntPoint& aPoint); virtual void SendAsyncScrollDOMEvent(FrameMetrics::ViewID aScrollId, const mozilla::CSSRect &aContentRect, const mozilla::CSSSize &aScrollableSize); virtual void PostDelayedTask(Task* aTask, int aDelayMs); virtual void HandlePanBegin(); virtual void HandlePanEnd(); }; -} } } \ No newline at end of file +} } } diff --git a/widget/xpwidgets/nsNativeTheme.cpp b/widget/xpwidgets/nsNativeTheme.cpp --- a/widget/xpwidgets/nsNativeTheme.cpp +++ b/widget/xpwidgets/nsNativeTheme.cpp @@ -424,17 +424,17 @@ nsNativeTheme::IsLastTreeHeaderCell(nsIF } // If the column picker is visible, this can't be the last column. if (parent && !parent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::hidecolumnpicker, NS_LITERAL_STRING("true"), eCaseMatters)) return false; while ((aFrame = aFrame->GetNextSibling())) { - if (aFrame->GetRect().width > 0) + if (aFrame->GetPhysicalRect().width > 0) return false; } return true; } // tab: bool nsNativeTheme::IsBottomTab(nsIFrame* aFrame) @@ -450,17 +450,17 @@ nsNativeTheme::IsBottomTab(nsIFrame* aFr bool nsNativeTheme::IsFirstTab(nsIFrame* aFrame) { if (!aFrame) return false; nsIFrame* first = aFrame->GetParent()->GetFirstPrincipalChild(); while (first) { - if (first->GetRect().width > 0 && first->GetContent()->Tag() == nsGkAtoms::tab) + if (first->GetPhysicalRect().width > 0 && first->GetContent()->Tag() == nsGkAtoms::tab) return (first == aFrame); first = first->GetNextSibling(); } return false; } bool nsNativeTheme::IsHorizontal(nsIFrame* aFrame) @@ -481,17 +481,17 @@ nsNativeTheme::IsNextToSelectedTab(nsIFr if (aOffset == 0) return IsSelectedTab(aFrame); int32_t thisTabIndex = -1, selectedTabIndex = -1; nsIFrame* currentTab = aFrame->GetParent()->GetFirstPrincipalChild(); for (int32_t i = 0; currentTab; currentTab = currentTab->GetNextSibling()) { - if (currentTab->GetRect().width == 0) + if (currentTab->GetPhysicalRect().width == 0) continue; if (aFrame == currentTab) thisTabIndex = i; if (IsSelectedTab(currentTab)) selectedTabIndex = i; ++i; } @@ -643,23 +643,23 @@ nsNativeTheme::GetAdjacentSiblingFrameWi { if (!aFrame) return nullptr; // Find the next visible sibling. nsIFrame* sibling = aFrame; do { sibling = aNextSibling ? sibling->GetNextSibling() : sibling->GetPrevSibling(); - } while (sibling && sibling->GetRect().width == 0); + } while (sibling && sibling->GetPhysicalRect().width == 0); // Check same appearance and adjacency. if (!sibling || sibling->StyleDisplay()->mAppearance != aFrame->StyleDisplay()->mAppearance || - (sibling->GetRect().XMost() != aFrame->GetRect().x && - aFrame->GetRect().XMost() != sibling->GetRect().x)) + (sibling->GetPhysicalRect().XMost() != aFrame->GetPhysicalRect().x && + aFrame->GetPhysicalRect().XMost() != sibling->GetPhysicalRect().x)) return nullptr; return sibling; } bool nsNativeTheme::IsRangeHorizontal(nsIFrame* aFrame) { nsIFrame* rangeFrame = aFrame;