Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /*-*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
michael@0 | 2 | * This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
michael@0 | 4 | * You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #include "nsDisplayListInvalidation.h" |
michael@0 | 7 | #include "nsDisplayList.h" |
michael@0 | 8 | #include "nsIFrame.h" |
michael@0 | 9 | |
michael@0 | 10 | nsDisplayItemGeometry::nsDisplayItemGeometry(nsDisplayItem* aItem, nsDisplayListBuilder* aBuilder) |
michael@0 | 11 | { |
michael@0 | 12 | MOZ_COUNT_CTOR(nsDisplayItemGeometry); |
michael@0 | 13 | bool snap; |
michael@0 | 14 | mBounds = aItem->GetBounds(aBuilder, &snap); |
michael@0 | 15 | } |
michael@0 | 16 | |
michael@0 | 17 | nsDisplayItemGeometry::~nsDisplayItemGeometry() |
michael@0 | 18 | { |
michael@0 | 19 | MOZ_COUNT_DTOR(nsDisplayItemGeometry); |
michael@0 | 20 | } |
michael@0 | 21 | |
michael@0 | 22 | nsDisplayItemGenericGeometry::nsDisplayItemGenericGeometry(nsDisplayItem* aItem, nsDisplayListBuilder* aBuilder) |
michael@0 | 23 | : nsDisplayItemGeometry(aItem, aBuilder) |
michael@0 | 24 | , mBorderRect(aItem->GetBorderRect()) |
michael@0 | 25 | {} |
michael@0 | 26 | |
michael@0 | 27 | void |
michael@0 | 28 | nsDisplayItemGenericGeometry::MoveBy(const nsPoint& aOffset) |
michael@0 | 29 | { |
michael@0 | 30 | mBounds.MoveBy(aOffset); |
michael@0 | 31 | mBorderRect.MoveBy(aOffset); |
michael@0 | 32 | } |
michael@0 | 33 | |
michael@0 | 34 | nsDisplayItemBoundsGeometry::nsDisplayItemBoundsGeometry(nsDisplayItem* aItem, nsDisplayListBuilder* aBuilder) |
michael@0 | 35 | : nsDisplayItemGeometry(aItem, aBuilder) |
michael@0 | 36 | { |
michael@0 | 37 | nscoord radii[8]; |
michael@0 | 38 | mHasRoundedCorners = aItem->Frame()->GetBorderRadii(radii); |
michael@0 | 39 | } |
michael@0 | 40 | |
michael@0 | 41 | void |
michael@0 | 42 | nsDisplayItemBoundsGeometry::MoveBy(const nsPoint& aOffset) |
michael@0 | 43 | { |
michael@0 | 44 | mBounds.MoveBy(aOffset); |
michael@0 | 45 | } |
michael@0 | 46 | |
michael@0 | 47 | nsDisplayBorderGeometry::nsDisplayBorderGeometry(nsDisplayItem* aItem, nsDisplayListBuilder* aBuilder) |
michael@0 | 48 | : nsDisplayItemGeometry(aItem, aBuilder) |
michael@0 | 49 | , mContentRect(aItem->GetContentRect()) |
michael@0 | 50 | {} |
michael@0 | 51 | |
michael@0 | 52 | void |
michael@0 | 53 | nsDisplayBorderGeometry::MoveBy(const nsPoint& aOffset) |
michael@0 | 54 | { |
michael@0 | 55 | mBounds.MoveBy(aOffset); |
michael@0 | 56 | mContentRect.MoveBy(aOffset); |
michael@0 | 57 | } |
michael@0 | 58 | |
michael@0 | 59 | nsDisplayBackgroundGeometry::nsDisplayBackgroundGeometry(nsDisplayBackgroundImage* aItem, |
michael@0 | 60 | nsDisplayListBuilder* aBuilder) |
michael@0 | 61 | : nsDisplayItemGeometry(aItem, aBuilder) |
michael@0 | 62 | , mPositioningArea(aItem->GetPositioningArea()) |
michael@0 | 63 | {} |
michael@0 | 64 | |
michael@0 | 65 | void |
michael@0 | 66 | nsDisplayBackgroundGeometry::MoveBy(const nsPoint& aOffset) |
michael@0 | 67 | { |
michael@0 | 68 | mBounds.MoveBy(aOffset); |
michael@0 | 69 | mPositioningArea.MoveBy(aOffset); |
michael@0 | 70 | } |
michael@0 | 71 | |
michael@0 | 72 | nsDisplayThemedBackgroundGeometry::nsDisplayThemedBackgroundGeometry(nsDisplayThemedBackground* aItem, |
michael@0 | 73 | nsDisplayListBuilder* aBuilder) |
michael@0 | 74 | : nsDisplayItemGeometry(aItem, aBuilder) |
michael@0 | 75 | , mPositioningArea(aItem->GetPositioningArea()) |
michael@0 | 76 | , mWindowIsActive(aItem->IsWindowActive()) |
michael@0 | 77 | {} |
michael@0 | 78 | |
michael@0 | 79 | void |
michael@0 | 80 | nsDisplayThemedBackgroundGeometry::MoveBy(const nsPoint& aOffset) |
michael@0 | 81 | { |
michael@0 | 82 | mBounds.MoveBy(aOffset); |
michael@0 | 83 | mPositioningArea.MoveBy(aOffset); |
michael@0 | 84 | } |
michael@0 | 85 | |
michael@0 | 86 | nsDisplayBoxShadowInnerGeometry::nsDisplayBoxShadowInnerGeometry(nsDisplayItem* aItem, nsDisplayListBuilder* aBuilder) |
michael@0 | 87 | : nsDisplayItemGeometry(aItem, aBuilder) |
michael@0 | 88 | , mPaddingRect(aItem->GetPaddingRect()) |
michael@0 | 89 | {} |
michael@0 | 90 | |
michael@0 | 91 | void |
michael@0 | 92 | nsDisplayBoxShadowInnerGeometry::MoveBy(const nsPoint& aOffset) |
michael@0 | 93 | { |
michael@0 | 94 | mBounds.MoveBy(aOffset); |
michael@0 | 95 | mPaddingRect.MoveBy(aOffset); |
michael@0 | 96 | } |
michael@0 | 97 |