mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-28 12:45:27 +00:00
aca985efab
This will help make it clearer that this code lives in a different module for contributors. --HG-- rename : layout/base/ActiveLayerTracker.cpp => layout/painting/ActiveLayerTracker.cpp rename : layout/base/ActiveLayerTracker.h => layout/painting/ActiveLayerTracker.h rename : layout/base/BorderCache.h => layout/painting/BorderCache.h rename : layout/base/BorderConsts.h => layout/painting/BorderConsts.h rename : layout/base/DashedCornerFinder.cpp => layout/painting/DashedCornerFinder.cpp rename : layout/base/DashedCornerFinder.h => layout/painting/DashedCornerFinder.h rename : layout/base/DisplayItemClip.cpp => layout/painting/DisplayItemClip.cpp rename : layout/base/DisplayItemClip.h => layout/painting/DisplayItemClip.h rename : layout/base/DisplayItemScrollClip.cpp => layout/painting/DisplayItemScrollClip.cpp rename : layout/base/DisplayItemScrollClip.h => layout/painting/DisplayItemScrollClip.h rename : layout/base/DisplayListClipState.cpp => layout/painting/DisplayListClipState.cpp rename : layout/base/DisplayListClipState.h => layout/painting/DisplayListClipState.h rename : layout/base/DottedCornerFinder.cpp => layout/painting/DottedCornerFinder.cpp rename : layout/base/DottedCornerFinder.h => layout/painting/DottedCornerFinder.h rename : layout/base/FrameLayerBuilder.cpp => layout/painting/FrameLayerBuilder.cpp rename : layout/base/FrameLayerBuilder.h => layout/painting/FrameLayerBuilder.h rename : layout/base/LayerState.h => layout/painting/LayerState.h rename : layout/base/MaskLayerImageCache.cpp => layout/painting/MaskLayerImageCache.cpp rename : layout/base/MaskLayerImageCache.h => layout/painting/MaskLayerImageCache.h rename : layout/base/PaintTracker.cpp => layout/painting/PaintTracker.cpp rename : layout/base/PaintTracker.h => layout/painting/PaintTracker.h rename : layout/base/nsCSSRendering.cpp => layout/painting/nsCSSRendering.cpp rename : layout/base/nsCSSRendering.h => layout/painting/nsCSSRendering.h rename : layout/base/nsCSSRenderingBorders.cpp => layout/painting/nsCSSRenderingBorders.cpp rename : layout/base/nsCSSRenderingBorders.h => layout/painting/nsCSSRenderingBorders.h rename : layout/base/nsDisplayItemTypes.h => layout/painting/nsDisplayItemTypes.h rename : layout/base/nsDisplayItemTypesList.h => layout/painting/nsDisplayItemTypesList.h rename : layout/base/nsDisplayList.cpp => layout/painting/nsDisplayList.cpp rename : layout/base/nsDisplayList.h => layout/painting/nsDisplayList.h rename : layout/base/nsDisplayListInvalidation.cpp => layout/painting/nsDisplayListInvalidation.cpp rename : layout/base/nsDisplayListInvalidation.h => layout/painting/nsDisplayListInvalidation.h
58 lines
1.5 KiB
C++
58 lines
1.5 KiB
C++
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#include "DisplayItemScrollClip.h"
|
|
|
|
#include "DisplayItemClip.h"
|
|
|
|
namespace mozilla {
|
|
|
|
/* static */ bool
|
|
DisplayItemScrollClip::IsAncestor(const DisplayItemScrollClip* aAncestor,
|
|
const DisplayItemScrollClip* aDescendant)
|
|
{
|
|
if (!aAncestor) {
|
|
// null means root.
|
|
return true;
|
|
}
|
|
|
|
for (const DisplayItemScrollClip* sc = aDescendant; sc; sc = sc->mParent) {
|
|
if (sc == aAncestor) {
|
|
return true;
|
|
}
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
bool
|
|
DisplayItemScrollClip::HasRoundedCorners() const
|
|
{
|
|
for (const DisplayItemScrollClip* scrollClip = this;
|
|
scrollClip; scrollClip = scrollClip->mParent) {
|
|
if (scrollClip->mClip->GetRoundedRectCount() > 0) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
/* static */ nsCString
|
|
DisplayItemScrollClip::ToString(const DisplayItemScrollClip* aScrollClip)
|
|
{
|
|
nsAutoCString str;
|
|
for (const DisplayItemScrollClip* scrollClip = aScrollClip;
|
|
scrollClip; scrollClip = scrollClip->mParent) {
|
|
str.AppendPrintf("<%s>%s", scrollClip->mClip ? scrollClip->mClip->ToString().get() : "null",
|
|
scrollClip->mIsAsyncScrollable ? " [async-scrollable]" : "");
|
|
if (scrollClip->mParent) {
|
|
str.Append(", ");
|
|
}
|
|
}
|
|
return str;
|
|
}
|
|
|
|
} // namespace mozilla
|