author | Mats Palmgren <mats@mozilla.com> |
Wed, 31 May 2017 21:29:49 +0200 | |
changeset 361662 | 422e3c006cf2b56d94f969d4b8e29b0982103437 |
parent 361661 | fc6012cad03e870b46ce4ddc2077762c31f8f9b7 |
child 361663 | ddcdb354143a9018a9bc94cef7a395ef46873f8b |
push id | 31935 |
push user | ryanvm@gmail.com |
push date | Thu, 01 Jun 2017 00:25:58 +0000 |
treeherder | mozilla-central@a8f378825e81 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | jfkthame |
bugs | 1368802 |
milestone | 55.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/layout/base/nsFrameTraversal.cpp +++ b/layout/base/nsFrameTraversal.cpp @@ -77,16 +77,20 @@ protected: */ virtual nsIFrame* GetFirstChildInner(nsIFrame* aFrame); virtual nsIFrame* GetLastChildInner(nsIFrame* aFrame); virtual nsIFrame* GetNextSiblingInner(nsIFrame* aFrame); virtual nsIFrame* GetPrevSiblingInner(nsIFrame* aFrame); + /** + * Return the placeholder frame for aFrame if it has one, otherwise return + * aFrame itself. + */ nsIFrame* GetPlaceholderFrame(nsIFrame* aFrame); bool IsPopupFrame(nsIFrame* aFrame); nsPresContext* const mPresContext; const bool mLockScroll; const bool mFollowOOFs; const bool mSkipPopupChecks; const nsIteratorType mType; @@ -479,28 +483,22 @@ nsIFrame* nsFrameIterator::GetPrevSiblingInner(nsIFrame* aFrame) { return aFrame->GetPrevSibling(); } nsIFrame* nsFrameIterator::GetPlaceholderFrame(nsIFrame* aFrame) { - nsIFrame* result = aFrame; - nsIPresShell *presShell = mPresContext->GetPresShell(); - if (presShell) { - nsIFrame* placeholder = presShell->GetPlaceholderFrameFor(aFrame); - if (placeholder) - result = placeholder; + if (MOZ_LIKELY(!aFrame || !aFrame->HasAnyStateBits(NS_FRAME_OUT_OF_FLOW))) { + return aFrame; } - - if (result != aFrame) - result = GetPlaceholderFrame(result); - - return result; + nsIFrame* placeholder = + aFrame->PresContext()->PresShell()->GetPlaceholderFrameFor(aFrame); + return placeholder ? placeholder : aFrame; } bool nsFrameIterator::IsPopupFrame(nsIFrame* aFrame) { // If skipping popup checks, pretend this isn't one. if (mSkipPopupChecks) { return false;