mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-26 14:30:27 +00:00
a7ea204c19
- fix restore button on MacOS 10.6 fullscreen (08151078bd)
- Bug 1216580 - Make background-position:fixed clip stealing work with display items that create their own layer. r=mattwoodrow (7760c8ddd8)
- Bug 1222661 - Replace ToUntyped(obj) calls with obj.ToUnknown*(). r=nical (76e36824f0)
- Bug 1223310 (part 1) - Pass a LayoutDeviceIntPoint instead of an nsIntPoint to InitEvent(). r=kats. (ea95207afe)
- Bug 1223310 (part 2) - Use LayoutDeviceIntRect for bounds-related functions in nsIWidget. r=kats. (4993cccff8)
- Bug 1218552 - Fix GTK drag-and-drop coordinate scaling on HiDPI displays (r=karlt) (d03cf04136)
- fix preprocessing (2f4c1a1c94)
- Bug 1205923: Make VectorImage::GetWidth/GetHeight set outparam to 0 (not -1) on failure, to accomodate callers that don't check error codes. r=seth (487de31340)
- Bug 1212954 - Make BaseSize::IsEmpty return true for negative sizes to avoid NS_ERROR in VectorImage::GetFrameAtSize when root svg doesn't have intrinsic width or height. r=roc (402b154f56)
- fix ordering (ac8483c966)
- Bug 1216056 - Always sent OpRemoveTextureAsync as pending async Messages r=nica (66c9ee8708)
- Bug 121976 - Add a destruction handshake to PCompositable so as to avoid races between messages and the protocol. r=sotaro (636a669e44)
- Bug 1209724 - Cancel ImageBridge proxy functions if they are called too late. r=sotao (5bf81453ef)
- Bug 1221371 - Switch chromium IPC code to use mozilla::Tuple (r=jld,cpearce,kats) (eebcd419e9)
- Bug 1221371 - Remove unused Chromium callback code (r=jld) (3f2e882485)
- Bug 1221368 - Change MakeTuple to decay the types of its arguments (r=froydnj) (bed635f565)
- Bug 1181303. Set composition time earlier so that computing invalid regions works properly. r=mattwoodrow (7a3e41cd96)
- Bug 1150552 - Fix partial present bug with FPS counter. r=mattwoodrow (6e6ae92909)
- Bug 1216287 - Properly invalidate the debug overlay. r=mattwoodrow (60d4f3451a)
- Compute the compositor's damage region before composites, rather than layers updates. (bug 1217560, r=mattwoodrow) (6efcac085b)
- Bug 1216248 - Recomposite when the window overlay changes. r=mattwoodrow (8a8c5ccd07)
- Bug 1224021 - Support fractional async scroll offsets in the reftest harness. r=tn (353f75d3aa)
- Bug 1121072 - Always notify when layers cleared (r=dvander) (aa6ffc67e2)
- Bug 1224403 (part 1) - Make Configuration::mBounds a LayoutDeviceIntRect. r=kats. (7617b9da7e)
- Bug 1224403 (part 2) - Split GetClientOffset() into typed and untyped versions. r=kats. (06916479b1)
- Bug 1224403 (part 3) - Make mNonClientOffset a LayoutDeviceIntMargin. r=kats. (76efba1fb6)
- Bug 1224403 (part 4) - Make {Get,Set}NonClientMargins() return/take aLayoutDeviceIntMargin. r=kats. (99cfc2fdbc)
- Bug 1224403 (part 5) - Make OnDefaultButtonLoaded() return/take a LayoutDeviceIntMargin. r=kats (c402452f97)
- Bug 1224403 (part 6) - Remove one WidgetToScreenOffsetUntyped() call. r=kats. (8e4485a404)
- Bug 1224403 (part 7) - Use LayoutDeviceIntMargin more in IMMHandler. r=kats. (6b5e9124fc)
- Bug 1224403 (part 8) - Use LayoutDeviceIntMargin more in HyperTextAccessible. r=kats. (5bc1a04cc7)
- Bug 1224403 (part 9) - Remove GetRestoredBoundsUntyped(). r=kats. (20e2b28335)
- Bug 1224403 (part 10) - Make nsScreenGonk::GetNaturalBoundsUntyped() typed. r=kats. (9d19986f22)
- Bug 1224403 (part 11) - Remove a GetBoundsUntyped() call. r=kats. (58ce962157)
- Bug 1214267 - Followup to fix missing propagation of 'fixedPositionSides' to the compositor, and add it to the layers dump. r=mattwoodrow (7dc122eb62)
- Use compositor clip rects, not client clip rects, when computing the compositor's backbuffer damage region. (bug 1189159, r=mattwoodrow) (b70d71b1b7)
- Bug 1210784 - Layer tree invalidation with Preserves3D. r=roc (8a7bfa1a22)
- Bug 1166165 - Check if the timestamp is null to prevent assertion. r=nical (189a8d42d0)
- Bug 1137004 - Changed the location of the counter so when it is used in a maximized window it is no longer cut off, and added a little left padding. r=mattwoodrow (140d294445)
- Bug 1222661 - Replace FromUntyped(obj) calls with FromUnknown*(obj). r=nical (b399ccef2e)
- Bug 1216506. Properly initialize min inset box shadow color to black. r=mstange (335259200c)
- Bug 1223690 - Remove implicit Rect conversions. r=jrmuizel. (5aef25158f)
- Bug 1056356 - Allow calling NewRunnableMethod() with a const pointer to the callee object. r=froydnj (145279b91c)
- Bug 1209649. Part 2: Reftest to test box shadows and border radii. r=mstange (9405ccfe23)
- Bug 1211363. Part 2: reftest with int border radius. r=mstange (9edb37635e)
- Bug 1216200. Inset box shadow reftest with negative spread value. r=mstange (8350478107)
- Bug 1211264. Fallback to render dest rect with outer box shadows on non-int transforms. r=mstange (a244775d24)
- Bug 1216200. Correct for negative spread values with inset box shadows. r=mstange (4851e9c792)
- cleanup (1f78332ad8)
- Bug 1213970 - Enable APZ on iOS r=kats (1d170e32e3)
- Bug 1217939 - part 1 - remove nsContentUtils::GetViewportInfo; r=smaug (8c25236851)
- Bug 1217939 - part 2 - move nsContentUtils::GetSelectionBoundingRect to nsLayoutUtils; r=smaug (6beb37157c)
- Bug 1146713 - Don't export NO_PKG_FILES (fix ssltunnel in b2g); r=glandium (a21152c79c)
- Bug 1222323 - Avoid passing extra defines to the compiler from config.mk. r=gps (2d1076d513)
- Bug 1222321 - Avoid the duplication of OS_CPPFLAGS on the compiler command line. r=gps (cf762f1644)
- Bug 1210687 - Separate out jar.mn parsing in a separate class. r=gps (d54cc5576b)
- Bug 1219147 - Use addEntriesToListFile in mozbuild.jar.JarMaker.updateManifest. r=mshal (3cd74ff478)
- Bug 1208160 - Show information when Xcode requires accepting license agreement; r=gps (352bb43d73)
- Bug 1174524 - Make objdir path comparison case-insensitive on Windows. r=mshal (6f74f10845)
- Bug 1158898 - Cache config.guess output; r=mshal (a7b01184fa)
- Bug 1187245 - Make .mozconfig.mk environment variables available to mach valgrind-test. r=gps (2033642ceb)
303 lines
6.4 KiB
C++
303 lines
6.4 KiB
C++
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
/* 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 "mozilla/Assertions.h"
|
|
#include "mozilla/Move.h"
|
|
#include "mozilla/Pair.h"
|
|
#include "mozilla/Tuple.h"
|
|
#include "mozilla/TypeTraits.h"
|
|
#include "mozilla/UniquePtr.h"
|
|
#include "mozilla/unused.h"
|
|
|
|
#include <stddef.h>
|
|
#include <utility>
|
|
|
|
using mozilla::Get;
|
|
using mozilla::IsSame;
|
|
using mozilla::MakeTuple;
|
|
using mozilla::MakeUnique;
|
|
using mozilla::Move;
|
|
using mozilla::Pair;
|
|
using mozilla::Tie;
|
|
using mozilla::Tuple;
|
|
using mozilla::UniquePtr;
|
|
using mozilla::Unused;
|
|
using std::pair;
|
|
|
|
#if (_MSC_VER == 1800)
|
|
// Optimizations in VS2013 on Windows 10 cause an internal compiler error
|
|
// with this file.
|
|
#pragma optimize("", off)
|
|
#endif
|
|
|
|
#define CHECK(c) \
|
|
do { \
|
|
bool cond = !!(c); \
|
|
MOZ_RELEASE_ASSERT(cond, "Failed assertion: " #c); \
|
|
} while (false)
|
|
|
|
// The second argument is the expected type. It's variadic to allow the
|
|
// type to contain commas.
|
|
#define CHECK_TYPE(expression, ...) \
|
|
static_assert(IsSame<decltype(expression), __VA_ARGS__>::value, \
|
|
"Type mismatch!")
|
|
|
|
struct ConvertibleToInt
|
|
{
|
|
operator int() const { return 42; }
|
|
};
|
|
|
|
static void
|
|
TestConstruction()
|
|
{
|
|
// Default construction
|
|
Tuple<> a;
|
|
Unused << a;
|
|
Tuple<int> b;
|
|
Unused << b;
|
|
|
|
// Construction from elements
|
|
int x = 1, y = 1;
|
|
Tuple<int, int> c{x, y};
|
|
Tuple<int&, const int&> d{x, y};
|
|
x = 42;
|
|
y = 42;
|
|
CHECK(Get<0>(c) == 1);
|
|
CHECK(Get<1>(c) == 1);
|
|
CHECK(Get<0>(d) == 42);
|
|
CHECK(Get<1>(d) == 42);
|
|
|
|
// Construction from objects convertible to the element types
|
|
Tuple<int, int> e{1.0, ConvertibleToInt{}};
|
|
|
|
// Copy construction
|
|
Tuple<int> x1;
|
|
Tuple<int> x2{x1};
|
|
|
|
Tuple<int, int> f(c);
|
|
CHECK(Get<0>(f) == 1);
|
|
CHECK(Get<0>(f) == 1);
|
|
|
|
// Move construction
|
|
Tuple<UniquePtr<int>> g{MakeUnique<int>(42)};
|
|
Tuple<UniquePtr<int>> h{Move(g)};
|
|
CHECK(Get<0>(g) == nullptr);
|
|
CHECK(*Get<0>(h) == 42);
|
|
}
|
|
|
|
static void
|
|
TestConstructionFromMozPair()
|
|
{
|
|
// Construction from elements
|
|
int x = 1, y = 1;
|
|
Pair<int, int> a{x, y};
|
|
Pair<int&, const int&> b{x, y};
|
|
Tuple<int, int> c(a);
|
|
Tuple<int&, const int&> d(b);
|
|
x = 42;
|
|
y = 42;
|
|
CHECK(Get<0>(c) == 1);
|
|
CHECK(Get<1>(c) == 1);
|
|
CHECK(Get<0>(d) == 42);
|
|
CHECK(Get<1>(d) == 42);
|
|
}
|
|
|
|
static void
|
|
TestConstructionFromStdPair()
|
|
{
|
|
// Construction from elements
|
|
int x = 1, y = 1;
|
|
pair<int, int> a{x, y};
|
|
pair<int&, const int&> b{x, y};
|
|
Tuple<int, int> c(a);
|
|
Tuple<int&, const int&> d(b);
|
|
x = 42;
|
|
y = 42;
|
|
CHECK(Get<0>(c) == 1);
|
|
CHECK(Get<1>(c) == 1);
|
|
CHECK(Get<0>(d) == 42);
|
|
CHECK(Get<1>(d) == 42);
|
|
}
|
|
|
|
static void
|
|
TestAssignment()
|
|
{
|
|
// Copy assignment
|
|
Tuple<int> a{0};
|
|
Tuple<int> b{42};
|
|
a = b;
|
|
CHECK(Get<0>(a) == 42);
|
|
|
|
// Assignment to reference member
|
|
int i = 0;
|
|
int j = 42;
|
|
Tuple<int&> c{i};
|
|
Tuple<int&> d{j};
|
|
c = d;
|
|
CHECK(i == 42);
|
|
|
|
// Move assignment
|
|
Tuple<UniquePtr<int>> e{MakeUnique<int>(0)};
|
|
Tuple<UniquePtr<int>> f{MakeUnique<int>(42)};
|
|
e = Move(f);
|
|
CHECK(*Get<0>(e) == 42);
|
|
CHECK(Get<0>(f) == nullptr);
|
|
}
|
|
|
|
static void
|
|
TestAssignmentFromMozPair()
|
|
{
|
|
// Copy assignment
|
|
Tuple<int, int> a{0, 0};
|
|
Pair<int, int> b{42, 42};
|
|
a = b;
|
|
CHECK(Get<0>(a) == 42);
|
|
CHECK(Get<1>(a) == 42);
|
|
|
|
// Assignment to reference member
|
|
int i = 0;
|
|
int j = 0;
|
|
int k = 42;
|
|
Tuple<int&, int&> c{i, j};
|
|
Pair<int&, int&> d{k, k};
|
|
c = d;
|
|
CHECK(i == 42);
|
|
CHECK(j == 42);
|
|
|
|
// Move assignment
|
|
Tuple<UniquePtr<int>, UniquePtr<int>> e{MakeUnique<int>(0),
|
|
MakeUnique<int>(0)};
|
|
Pair<UniquePtr<int>, UniquePtr<int>> f{MakeUnique<int>(42),
|
|
MakeUnique<int>(42)};
|
|
e = Move(f);
|
|
CHECK(*Get<0>(e) == 42);
|
|
CHECK(*Get<1>(e) == 42);
|
|
CHECK(f.first() == nullptr);
|
|
CHECK(f.second() == nullptr);
|
|
}
|
|
|
|
static void
|
|
TestAssignmentFromStdPair()
|
|
{
|
|
// Copy assignment
|
|
Tuple<int, int> a{0, 0};
|
|
pair<int, int> b{42, 42};
|
|
a = b;
|
|
CHECK(Get<0>(a) == 42);
|
|
CHECK(Get<1>(a) == 42);
|
|
|
|
// Assignment to reference member
|
|
int i = 0;
|
|
int j = 0;
|
|
int k = 42;
|
|
Tuple<int&, int&> c{i, j};
|
|
pair<int&, int&> d{k, k};
|
|
c = d;
|
|
CHECK(i == 42);
|
|
CHECK(j == 42);
|
|
|
|
// Move assignment.
|
|
Tuple<UniquePtr<int>, UniquePtr<int>> e{MakeUnique<int>(0), MakeUnique<int>(0)};
|
|
// XXX: On some platforms std::pair doesn't support move constructor.
|
|
pair<UniquePtr<int>, UniquePtr<int>> f;
|
|
f.first = MakeUnique<int>(42);
|
|
f.second = MakeUnique<int>(42);
|
|
|
|
e = Move(f);
|
|
CHECK(*Get<0>(e) == 42);
|
|
CHECK(*Get<1>(e) == 42);
|
|
CHECK(f.first == nullptr);
|
|
CHECK(f.second == nullptr);
|
|
}
|
|
|
|
static void
|
|
TestGet()
|
|
{
|
|
int x = 1;
|
|
int y = 2;
|
|
int z = 3;
|
|
Tuple<int, int&, const int&> tuple(x, y, z);
|
|
|
|
// Using Get<>() to read elements
|
|
CHECK(Get<0>(tuple) == 1);
|
|
CHECK(Get<1>(tuple) == 2);
|
|
CHECK(Get<2>(tuple) == 3);
|
|
|
|
// Using Get<>() to write to elements
|
|
Get<0>(tuple) = 41;
|
|
CHECK(Get<0>(tuple) == 41);
|
|
|
|
// Writing through reference elements
|
|
Get<1>(tuple) = 42;
|
|
CHECK(Get<1>(tuple) == 42);
|
|
CHECK(y == 42);
|
|
}
|
|
|
|
static void
|
|
TestMakeTuple()
|
|
{
|
|
auto tuple = MakeTuple(42, 0.5f, 'c');
|
|
CHECK_TYPE(tuple, Tuple<int, float, char>);
|
|
CHECK(Get<0>(tuple) == 42);
|
|
CHECK(Get<1>(tuple) == 0.5f);
|
|
CHECK(Get<2>(tuple) == 'c');
|
|
|
|
// Make sure we don't infer the type to be Tuple<int&>.
|
|
int x = 1;
|
|
auto tuple2 = MakeTuple(x);
|
|
CHECK_TYPE(tuple2, Tuple<int>);
|
|
x = 2;
|
|
CHECK(Get<0>(tuple2) == 1);
|
|
}
|
|
|
|
static bool
|
|
TestTie()
|
|
{
|
|
int i;
|
|
float f;
|
|
char c;
|
|
Tuple<int, float, char> rhs1(42, 0.5f, 'c');
|
|
Tie(i, f, c) = rhs1;
|
|
CHECK(i == Get<0>(rhs1));
|
|
CHECK(f == Get<1>(rhs1));
|
|
CHECK(c == Get<2>(rhs1));
|
|
// Test conversions
|
|
Tuple<ConvertibleToInt, double, unsigned char> rhs2(ConvertibleToInt(),
|
|
0.7f, 'd');
|
|
Tie(i, f, c) = rhs2;
|
|
CHECK(i == Get<0>(rhs2));
|
|
CHECK(f == Get<1>(rhs2));
|
|
CHECK(c == Get<2>(rhs2));
|
|
|
|
// Test Pair
|
|
Pair<int, float> rhs3(-1, 1.2f);
|
|
Tie(i, f) = rhs3;
|
|
CHECK(i == rhs3.first());
|
|
CHECK(f == rhs3.second());
|
|
|
|
pair<int, float> rhs4(42, 1.5f);
|
|
Tie(i, f) = rhs4;
|
|
CHECK(i == rhs4.first);
|
|
CHECK(f == rhs4.second);
|
|
|
|
return true;
|
|
}
|
|
|
|
int
|
|
main()
|
|
{
|
|
TestConstruction();
|
|
TestConstructionFromMozPair();
|
|
TestConstructionFromStdPair();
|
|
TestAssignment();
|
|
TestAssignmentFromMozPair();
|
|
TestAssignmentFromStdPair();
|
|
TestGet();
|
|
TestMakeTuple();
|
|
TestTie();
|
|
return 0;
|
|
}
|