mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-17 22:32:51 +00:00
Bug 1269321: Part 1 - Add a way to check if the current clip has rounded corners. r=mstange
--HG-- extra : rebase_source : ebdb701125fb1ec910f09af938dcea9d95fe442f
This commit is contained in:
parent
6a070f7366
commit
8882773da0
@ -27,6 +27,18 @@ DisplayItemScrollClip::IsAncestor(const DisplayItemScrollClip* aAncestor,
|
||||
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)
|
||||
{
|
||||
|
@ -90,6 +90,8 @@ public:
|
||||
*/
|
||||
static nsCString ToString(const DisplayItemScrollClip* aScrollClip);
|
||||
|
||||
bool HasRoundedCorners() const;
|
||||
|
||||
/**
|
||||
* The previous (outer) scroll clip, or null.
|
||||
*/
|
||||
|
@ -269,6 +269,24 @@ public:
|
||||
Restore();
|
||||
}
|
||||
|
||||
bool SavedStateHasRoundedCorners()
|
||||
{
|
||||
const DisplayItemScrollClip* scrollClip = mSavedState.GetCurrentInnermostScrollClip();
|
||||
if (scrollClip && scrollClip->HasRoundedCorners()) {
|
||||
return true;
|
||||
}
|
||||
const DisplayItemClip* clip = mSavedState.GetClipForContainingBlockDescendants();
|
||||
if (clip && clip->GetRoundedRectCount() > 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
clip = mSavedState.GetClipForContentDescendants();
|
||||
if (clip && clip->GetRoundedRectCount() > 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void TurnClipIntoScrollClipForContentDescendants(nsDisplayListBuilder* aBuilder, nsIScrollableFrame* aScrollableFrame)
|
||||
{
|
||||
NS_ASSERTION(!mRestored, "Already restored!");
|
||||
|
Loading…
x
Reference in New Issue
Block a user