Backed out 15 changesets (bug 951793) because it landed before the necessary servo changes. r=backout requested by emilio on a CLOSED TREE
Backed out changeset ca8c86e229df (bug 951793) Backed out changeset 6eef6403fa71 (bug 951793) Backed out changeset a5e529f52fb1 (bug 951793) Backed out changeset 054e837609d0 (bug 951793) Backed out changeset 713a3c9617ce (bug 951793) Backed out changeset 884913aa1668 (bug 951793) Backed out changeset c3340b84e534 (bug 951793) Backed out changeset 50fe3c6ac486 (bug 951793) Backed out changeset be4e22e5c257 (bug 951793) Backed out changeset 7055bd5dfc4e (bug 951793) Backed out changeset fa6da1e723cf (bug 951793) Backed out changeset 386f77004d89 (bug 951793) Backed out changeset fa82cdc01408 (bug 951793) Backed out changeset 867d8ea5355c (bug 951793) Backed out changeset e61ac8e48971 (bug 951793)
This commit is contained in:
@@ -3133,8 +3133,6 @@ exports.CSS_PROPERTIES = {
|
|||||||
"ruby-align",
|
"ruby-align",
|
||||||
"ruby-position",
|
"ruby-position",
|
||||||
"scroll-behavior",
|
"scroll-behavior",
|
||||||
"overscroll-behavior-x",
|
|
||||||
"overscroll-behavior-y",
|
|
||||||
"scroll-snap-coordinate",
|
"scroll-snap-coordinate",
|
||||||
"scroll-snap-destination",
|
"scroll-snap-destination",
|
||||||
"scroll-snap-points-x",
|
"scroll-snap-points-x",
|
||||||
@@ -8315,52 +8313,6 @@ exports.CSS_PROPERTIES = {
|
|||||||
"visible"
|
"visible"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"overscroll-behavior": {
|
|
||||||
"isInherited": false,
|
|
||||||
"subproperties": [
|
|
||||||
"overscroll-behavior-x",
|
|
||||||
"overscroll-behavior-y"
|
|
||||||
],
|
|
||||||
"supports": [],
|
|
||||||
"values": [
|
|
||||||
"auto",
|
|
||||||
"contain",
|
|
||||||
"inherit",
|
|
||||||
"initial",
|
|
||||||
"none",
|
|
||||||
"unset"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"overscroll-behavior-x": {
|
|
||||||
"isInherited": false,
|
|
||||||
"subproperties": [
|
|
||||||
"overscroll-behavior-x"
|
|
||||||
],
|
|
||||||
"supports": [],
|
|
||||||
"values": [
|
|
||||||
"auto",
|
|
||||||
"contain",
|
|
||||||
"inherit",
|
|
||||||
"initial",
|
|
||||||
"none",
|
|
||||||
"unset"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"overscroll-behavior-y": {
|
|
||||||
"isInherited": false,
|
|
||||||
"subproperties": [
|
|
||||||
"overscroll-behavior-y"
|
|
||||||
],
|
|
||||||
"supports": [],
|
|
||||||
"values": [
|
|
||||||
"auto",
|
|
||||||
"contain",
|
|
||||||
"inherit",
|
|
||||||
"initial",
|
|
||||||
"none",
|
|
||||||
"unset"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"padding": {
|
"padding": {
|
||||||
"isInherited": false,
|
"isInherited": false,
|
||||||
"subproperties": [
|
"subproperties": [
|
||||||
@@ -10018,18 +9970,6 @@ exports.PREFERENCES = [
|
|||||||
"scroll-behavior",
|
"scroll-behavior",
|
||||||
"layout.css.scroll-behavior.property-enabled"
|
"layout.css.scroll-behavior.property-enabled"
|
||||||
],
|
],
|
||||||
[
|
|
||||||
"overscroll-behavior",
|
|
||||||
"layout.css.overscroll-behavior.enabled"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"overscroll-behavior-x",
|
|
||||||
"layout.css.overscroll-behavior.enabled"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"overscroll-behavior-y",
|
|
||||||
"layout.css.overscroll-behavior.enabled"
|
|
||||||
],
|
|
||||||
[
|
[
|
||||||
"scroll-snap-coordinate",
|
"scroll-snap-coordinate",
|
||||||
"layout.css.scroll-snap.enabled"
|
"layout.css.scroll-snap.enabled"
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
|
|
||||||
#include "FrameMetrics.h"
|
#include "FrameMetrics.h"
|
||||||
#include "gfxPrefs.h"
|
#include "gfxPrefs.h"
|
||||||
#include "nsStyleConsts.h"
|
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace layers {
|
namespace layers {
|
||||||
@@ -19,31 +18,6 @@ ScrollMetadata::SetUsesContainerScrolling(bool aValue) {
|
|||||||
mUsesContainerScrolling = aValue;
|
mUsesContainerScrolling = aValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
static OverscrollBehavior
|
|
||||||
ToOverscrollBehavior(StyleOverscrollBehavior aBehavior)
|
|
||||||
{
|
|
||||||
switch (aBehavior) {
|
|
||||||
case StyleOverscrollBehavior::Auto:
|
|
||||||
return OverscrollBehavior::Auto;
|
|
||||||
case StyleOverscrollBehavior::Contain:
|
|
||||||
return OverscrollBehavior::Contain;
|
|
||||||
case StyleOverscrollBehavior::None:
|
|
||||||
return OverscrollBehavior::None;
|
|
||||||
}
|
|
||||||
MOZ_ASSERT_UNREACHABLE("Invalid overscroll behavior");
|
|
||||||
return OverscrollBehavior::Auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
OverscrollBehaviorInfo
|
|
||||||
OverscrollBehaviorInfo::FromStyleConstants(StyleOverscrollBehavior aBehaviorX,
|
|
||||||
StyleOverscrollBehavior aBehaviorY)
|
|
||||||
{
|
|
||||||
OverscrollBehaviorInfo result;
|
|
||||||
result.mBehaviorX = ToOverscrollBehavior(aBehaviorX);
|
|
||||||
result.mBehaviorY = ToOverscrollBehavior(aBehaviorY);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
StaticAutoPtr<const ScrollMetadata> ScrollMetadata::sNullMetadata;
|
StaticAutoPtr<const ScrollMetadata> ScrollMetadata::sNullMetadata;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -721,32 +721,6 @@ struct ScrollSnapInfo {
|
|||||||
nsTArray<nsPoint> mScrollSnapCoordinates;
|
nsTArray<nsPoint> mScrollSnapCoordinates;
|
||||||
};
|
};
|
||||||
|
|
||||||
MOZ_DEFINE_ENUM_CLASS_WITH_BASE(
|
|
||||||
OverscrollBehavior, uint8_t, (
|
|
||||||
Auto,
|
|
||||||
Contain,
|
|
||||||
None
|
|
||||||
));
|
|
||||||
|
|
||||||
struct OverscrollBehaviorInfo {
|
|
||||||
OverscrollBehaviorInfo()
|
|
||||||
: mBehaviorX(OverscrollBehavior::Auto)
|
|
||||||
, mBehaviorY(OverscrollBehavior::Auto)
|
|
||||||
{}
|
|
||||||
|
|
||||||
// Construct from StyleOverscrollBehavior values.
|
|
||||||
static OverscrollBehaviorInfo FromStyleConstants(StyleOverscrollBehavior aBehaviorX,
|
|
||||||
StyleOverscrollBehavior aBehaviorY);
|
|
||||||
|
|
||||||
bool operator==(const OverscrollBehaviorInfo& aOther) const {
|
|
||||||
return mBehaviorX == aOther.mBehaviorX &&
|
|
||||||
mBehaviorY == aOther.mBehaviorY;
|
|
||||||
}
|
|
||||||
|
|
||||||
OverscrollBehavior mBehaviorX;
|
|
||||||
OverscrollBehavior mBehaviorY;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A clip that applies to a layer, that may be scrolled by some of the
|
* A clip that applies to a layer, that may be scrolled by some of the
|
||||||
* scroll frames associated with the layer.
|
* scroll frames associated with the layer.
|
||||||
@@ -823,7 +797,6 @@ public:
|
|||||||
, mIsLayersIdRoot(false)
|
, mIsLayersIdRoot(false)
|
||||||
, mUsesContainerScrolling(false)
|
, mUsesContainerScrolling(false)
|
||||||
, mForceDisableApz(false)
|
, mForceDisableApz(false)
|
||||||
, mOverscrollBehavior()
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
bool operator==(const ScrollMetadata& aOther) const
|
bool operator==(const ScrollMetadata& aOther) const
|
||||||
@@ -840,8 +813,7 @@ public:
|
|||||||
mAllowVerticalScrollWithWheel == aOther.mAllowVerticalScrollWithWheel &&
|
mAllowVerticalScrollWithWheel == aOther.mAllowVerticalScrollWithWheel &&
|
||||||
mIsLayersIdRoot == aOther.mIsLayersIdRoot &&
|
mIsLayersIdRoot == aOther.mIsLayersIdRoot &&
|
||||||
mUsesContainerScrolling == aOther.mUsesContainerScrolling &&
|
mUsesContainerScrolling == aOther.mUsesContainerScrolling &&
|
||||||
mForceDisableApz == aOther.mForceDisableApz &&
|
mForceDisableApz == aOther.mForceDisableApz;
|
||||||
mOverscrollBehavior == aOther.mOverscrollBehavior;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator!=(const ScrollMetadata& aOther) const
|
bool operator!=(const ScrollMetadata& aOther) const
|
||||||
@@ -951,13 +923,6 @@ public:
|
|||||||
return mForceDisableApz;
|
return mForceDisableApz;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetOverscrollBehavior(const OverscrollBehaviorInfo& aOverscrollBehavior) {
|
|
||||||
mOverscrollBehavior = aOverscrollBehavior;
|
|
||||||
}
|
|
||||||
const OverscrollBehaviorInfo& GetOverscrollBehavior() const {
|
|
||||||
return mOverscrollBehavior;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
FrameMetrics mMetrics;
|
FrameMetrics mMetrics;
|
||||||
|
|
||||||
@@ -1007,9 +972,6 @@ private:
|
|||||||
// scrollframe.
|
// scrollframe.
|
||||||
bool mForceDisableApz:1;
|
bool mForceDisableApz:1;
|
||||||
|
|
||||||
// The overscroll behavior for this scroll frame.
|
|
||||||
OverscrollBehaviorInfo mOverscrollBehavior;
|
|
||||||
|
|
||||||
// WARNING!!!!
|
// WARNING!!!!
|
||||||
//
|
//
|
||||||
// When adding new fields to ScrollMetadata, the following places should be
|
// When adding new fields to ScrollMetadata, the following places should be
|
||||||
|
|||||||
@@ -177,28 +177,6 @@ AppendToString(std::stringstream& aStream, const EventRegions& e,
|
|||||||
aStream << "}" << sfx;
|
aStream << "}" << sfx;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
AppendToString(std::stringstream& aStream, OverscrollBehavior aBehavior,
|
|
||||||
const char* pfx, const char* sfx)
|
|
||||||
{
|
|
||||||
aStream << pfx;
|
|
||||||
switch (aBehavior) {
|
|
||||||
case OverscrollBehavior::Auto: {
|
|
||||||
aStream << "auto";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case OverscrollBehavior::Contain: {
|
|
||||||
aStream << "contain";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case OverscrollBehavior::None: {
|
|
||||||
aStream << "none";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
aStream << sfx;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
AppendToString(std::stringstream& aStream, const ScrollMetadata& m,
|
AppendToString(std::stringstream& aStream, const ScrollMetadata& m,
|
||||||
const char* pfx, const char* sfx)
|
const char* pfx, const char* sfx)
|
||||||
@@ -215,18 +193,6 @@ AppendToString(std::stringstream& aStream, const ScrollMetadata& m,
|
|||||||
if (m.HasMaskLayer()) {
|
if (m.HasMaskLayer()) {
|
||||||
AppendToString(aStream, m.ScrollClip().GetMaskLayerIndex().value(), "] [mask=");
|
AppendToString(aStream, m.ScrollClip().GetMaskLayerIndex().value(), "] [mask=");
|
||||||
}
|
}
|
||||||
OverscrollBehavior overscrollX = m.GetOverscrollBehavior().mBehaviorX;
|
|
||||||
OverscrollBehavior overscrollY = m.GetOverscrollBehavior().mBehaviorY;
|
|
||||||
if (overscrollX == overscrollY && overscrollX != OverscrollBehavior::Auto) {
|
|
||||||
AppendToString(aStream, overscrollX, "] [overscroll=");
|
|
||||||
} else {
|
|
||||||
if (overscrollX != OverscrollBehavior::Auto) {
|
|
||||||
AppendToString(aStream, overscrollX, "] [overscroll-x=");
|
|
||||||
}
|
|
||||||
if (overscrollY != OverscrollBehavior::Auto) {
|
|
||||||
AppendToString(aStream, overscrollY, "] [overscroll-y=");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
aStream << "] }" << sfx;
|
aStream << "] }" << sfx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -171,10 +171,6 @@ void
|
|||||||
AppendToString(std::stringstream& aStream, const EventRegions& e,
|
AppendToString(std::stringstream& aStream, const EventRegions& e,
|
||||||
const char* pfx="", const char* sfx="");
|
const char* pfx="", const char* sfx="");
|
||||||
|
|
||||||
void
|
|
||||||
AppendToString(std::stringstream& aStream, OverscrollBehavior aBehavior,
|
|
||||||
const char* pfx="", const char* sfx="");
|
|
||||||
|
|
||||||
void
|
void
|
||||||
AppendToString(std::stringstream& aStream, const ScrollMetadata& m,
|
AppendToString(std::stringstream& aStream, const ScrollMetadata& m,
|
||||||
const char* pfx="", const char* sfx="");
|
const char* pfx="", const char* sfx="");
|
||||||
|
|||||||
@@ -1198,9 +1198,6 @@ APZCTreeManager::ReceiveInputEvent(InputData& aEvent,
|
|||||||
apzc->GetGuid(aOutTargetGuid);
|
apzc->GetGuid(aOutTargetGuid);
|
||||||
panInput.mPanStartPoint = *untransformedStartPoint;
|
panInput.mPanStartPoint = *untransformedStartPoint;
|
||||||
panInput.mPanDisplacement = *untransformedDisplacement;
|
panInput.mPanDisplacement = *untransformedDisplacement;
|
||||||
|
|
||||||
panInput.mOverscrollBehaviorAllowsSwipe =
|
|
||||||
apzc->OverscrollBehaviorAllowsSwipe();
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
} case PINCHGESTURE_INPUT: { // note: no one currently sends these
|
} case PINCHGESTURE_INPUT: { // note: no one currently sends these
|
||||||
@@ -2032,16 +2029,16 @@ APZCTreeManager::DispatchScroll(AsyncPanZoomController* aPrev,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ParentLayerPoint
|
void
|
||||||
APZCTreeManager::DispatchFling(AsyncPanZoomController* aPrev,
|
APZCTreeManager::DispatchFling(AsyncPanZoomController* aPrev,
|
||||||
const FlingHandoffState& aHandoffState)
|
FlingHandoffState& aHandoffState)
|
||||||
{
|
{
|
||||||
// If immediate handoff is disallowed, do not allow handoff beyond the
|
// If immediate handoff is disallowed, do not allow handoff beyond the
|
||||||
// single APZC that's scrolled by the input block that triggered this fling.
|
// single APZC that's scrolled by the input block that triggered this fling.
|
||||||
if (aHandoffState.mIsHandoff &&
|
if (aHandoffState.mIsHandoff &&
|
||||||
!gfxPrefs::APZAllowImmediateHandoff() &&
|
!gfxPrefs::APZAllowImmediateHandoff() &&
|
||||||
aHandoffState.mScrolledApzc == aPrev) {
|
aHandoffState.mScrolledApzc == aPrev) {
|
||||||
return aHandoffState.mVelocity;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const OverscrollHandoffChain* chain = aHandoffState.mChain;
|
const OverscrollHandoffChain* chain = aHandoffState.mChain;
|
||||||
@@ -2049,6 +2046,9 @@ APZCTreeManager::DispatchFling(AsyncPanZoomController* aPrev,
|
|||||||
uint32_t overscrollHandoffChainLength = chain->Length();
|
uint32_t overscrollHandoffChainLength = chain->Length();
|
||||||
uint32_t startIndex;
|
uint32_t startIndex;
|
||||||
|
|
||||||
|
// This will store any velocity left over after the entire handoff.
|
||||||
|
ParentLayerPoint finalResidualVelocity = aHandoffState.mVelocity;
|
||||||
|
|
||||||
// The fling's velocity needs to be transformed from the screen coordinates
|
// The fling's velocity needs to be transformed from the screen coordinates
|
||||||
// of |aPrev| to the screen coordinates of |next|. To transform a velocity
|
// of |aPrev| to the screen coordinates of |next|. To transform a velocity
|
||||||
// correctly, we need to convert it to a displacement. For now, we do this
|
// correctly, we need to convert it to a displacement. For now, we do this
|
||||||
@@ -2065,78 +2065,64 @@ APZCTreeManager::DispatchFling(AsyncPanZoomController* aPrev,
|
|||||||
// IndexOf will return aOverscrollHandoffChain->Length() if
|
// IndexOf will return aOverscrollHandoffChain->Length() if
|
||||||
// |aPrev| is not found.
|
// |aPrev| is not found.
|
||||||
if (startIndex >= overscrollHandoffChainLength) {
|
if (startIndex >= overscrollHandoffChainLength) {
|
||||||
return aHandoffState.mVelocity;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
startIndex = 0;
|
startIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// This will store any velocity left over after the entire handoff.
|
|
||||||
ParentLayerPoint finalResidualVelocity = aHandoffState.mVelocity;
|
|
||||||
|
|
||||||
ParentLayerPoint currentVelocity = aHandoffState.mVelocity;
|
|
||||||
for (; startIndex < overscrollHandoffChainLength; startIndex++) {
|
for (; startIndex < overscrollHandoffChainLength; startIndex++) {
|
||||||
current = chain->GetApzcAtIndex(startIndex);
|
current = chain->GetApzcAtIndex(startIndex);
|
||||||
|
|
||||||
// Make sure the apzc about to be handled can be handled
|
// Make sure the apcz about to be handled can be handled
|
||||||
if (current == nullptr || current->IsDestroyed()) {
|
if (current == nullptr || current->IsDestroyed()) {
|
||||||
break;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
endPoint = startPoint + currentVelocity;
|
endPoint = startPoint + aHandoffState.mVelocity;
|
||||||
|
|
||||||
RefPtr<AsyncPanZoomController> prevApzc = (startIndex > 0)
|
// Only transform when current apcz can be transformed with previous
|
||||||
? chain->GetApzcAtIndex(startIndex - 1)
|
if (startIndex > 0) {
|
||||||
: nullptr;
|
|
||||||
|
|
||||||
// Only transform when current apzc can be transformed with previous
|
|
||||||
if (prevApzc) {
|
|
||||||
if (!TransformDisplacement(this,
|
if (!TransformDisplacement(this,
|
||||||
prevApzc,
|
chain->GetApzcAtIndex(startIndex - 1),
|
||||||
current,
|
current,
|
||||||
startPoint,
|
startPoint,
|
||||||
endPoint)) {
|
endPoint)) {
|
||||||
break;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ParentLayerPoint availableVelocity = (endPoint - startPoint);
|
ParentLayerPoint transformedVelocity = endPoint - startPoint;
|
||||||
ParentLayerPoint residualVelocity;
|
aHandoffState.mVelocity = transformedVelocity;
|
||||||
|
|
||||||
FlingHandoffState transformedHandoffState = aHandoffState;
|
if (current->AttemptFling(aHandoffState)) {
|
||||||
transformedHandoffState.mVelocity = availableVelocity;
|
// Coming out of AttemptFling(), the handoff state's velocity is the
|
||||||
|
// residual velocity after attempting to fling |current|.
|
||||||
|
ParentLayerPoint residualVelocity = aHandoffState.mVelocity;
|
||||||
|
|
||||||
// Obey overscroll-behavior.
|
// If there's no residual velocity, there's nothing more to hand off.
|
||||||
if (prevApzc) {
|
if (IsZero(residualVelocity)) {
|
||||||
residualVelocity += prevApzc->AdjustHandoffVelocityForOverscrollBehavior(transformedHandoffState.mVelocity);
|
finalResidualVelocity = ParentLayerPoint();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If there is residual velocity, subtract the proportion of used
|
||||||
|
// velocity from finalResidualVelocity and continue handoff along the
|
||||||
|
// chain.
|
||||||
|
if (!FuzzyEqualsAdditive(transformedVelocity.x,
|
||||||
|
residualVelocity.x, COORDINATE_EPSILON)) {
|
||||||
|
finalResidualVelocity.x *= (residualVelocity.x / transformedVelocity.x);
|
||||||
|
}
|
||||||
|
if (!FuzzyEqualsAdditive(transformedVelocity.y,
|
||||||
|
residualVelocity.y, COORDINATE_EPSILON)) {
|
||||||
|
finalResidualVelocity.y *= (residualVelocity.y / transformedVelocity.y);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
residualVelocity += current->AttemptFling(transformedHandoffState);
|
|
||||||
|
|
||||||
// If there's no residual velocity, there's nothing more to hand off.
|
|
||||||
if (IsZero(residualVelocity)) {
|
|
||||||
return ParentLayerPoint();
|
|
||||||
}
|
|
||||||
|
|
||||||
// If any of the velocity available to be handed off was consumed,
|
|
||||||
// subtract the proportion of consumed velocity from finalResidualVelocity.
|
|
||||||
// Note: it's important to compare |residualVelocity| to |availableVelocity|
|
|
||||||
// here and not to |transformedHandoffState.mVelocity|, since the latter
|
|
||||||
// may have been modified by AdjustHandoffVelocityForOverscrollBehavior().
|
|
||||||
if (!FuzzyEqualsAdditive(availableVelocity.x,
|
|
||||||
residualVelocity.x, COORDINATE_EPSILON)) {
|
|
||||||
finalResidualVelocity.x *= (residualVelocity.x / availableVelocity.x);
|
|
||||||
}
|
|
||||||
if (!FuzzyEqualsAdditive(availableVelocity.y,
|
|
||||||
residualVelocity.y, COORDINATE_EPSILON)) {
|
|
||||||
finalResidualVelocity.y *= (residualVelocity.y / availableVelocity.y);
|
|
||||||
}
|
|
||||||
|
|
||||||
currentVelocity = residualVelocity;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return any residual velocity left over after the entire handoff process.
|
// Set the handoff state's velocity to any residual velocity left over
|
||||||
return finalResidualVelocity;
|
// after the entire handoff process.
|
||||||
|
aHandoffState.mVelocity = finalResidualVelocity;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|||||||
@@ -422,14 +422,13 @@ public:
|
|||||||
* start a fling (in this case the fling is given to the
|
* start a fling (in this case the fling is given to the
|
||||||
* first APZC in the chain)
|
* first APZC in the chain)
|
||||||
*
|
*
|
||||||
* The return value is the "residual velocity", the portion of
|
* aHandoffState.mVelocity will be modified depending on how much of that
|
||||||
* |aHandoffState.mVelocity| that was not consumed by APZCs in the
|
* velocity has been consumed by APZCs in the overscroll hand-off chain.
|
||||||
* handoff chain doing flings.
|
|
||||||
* The caller can use this value to determine whether it should consume
|
* The caller can use this value to determine whether it should consume
|
||||||
* the excess velocity by going into overscroll.
|
* the excess velocity by going into an overscroll fling.
|
||||||
*/
|
*/
|
||||||
ParentLayerPoint DispatchFling(AsyncPanZoomController* aApzc,
|
void DispatchFling(AsyncPanZoomController* aApzc,
|
||||||
const FlingHandoffState& aHandoffState);
|
FlingHandoffState& aHandoffState);
|
||||||
|
|
||||||
void StartScrollbarDrag(
|
void StartScrollbarDrag(
|
||||||
const ScrollableLayerGuid& aGuid,
|
const ScrollableLayerGuid& aGuid,
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
#include "LayersTypes.h"
|
#include "LayersTypes.h"
|
||||||
#include "UnitTransforms.h"
|
#include "UnitTransforms.h"
|
||||||
#include "mozilla/gfx/Point.h"
|
#include "mozilla/gfx/Point.h"
|
||||||
#include "mozilla/EnumSet.h"
|
|
||||||
#include "mozilla/FloatingPoint.h"
|
#include "mozilla/FloatingPoint.h"
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
@@ -43,8 +42,6 @@ operator|(CancelAnimationFlags a, CancelAnimationFlags b)
|
|||||||
| static_cast<int>(b));
|
| static_cast<int>(b));
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef EnumSet<ScrollDirection> ScrollDirections;
|
|
||||||
|
|
||||||
enum class ScrollSource {
|
enum class ScrollSource {
|
||||||
// scrollTo() or something similar.
|
// scrollTo() or something similar.
|
||||||
DOM,
|
DOM,
|
||||||
|
|||||||
@@ -1592,10 +1592,10 @@ nsEventStatus AsyncPanZoomController::HandleEndOfPan()
|
|||||||
// null before calling DispatchFling(). This is necessary because Destroy(),
|
// null before calling DispatchFling(). This is necessary because Destroy(),
|
||||||
// which nulls out mTreeManager, could be called concurrently.
|
// which nulls out mTreeManager, could be called concurrently.
|
||||||
if (APZCTreeManager* treeManagerLocal = GetApzcTreeManager()) {
|
if (APZCTreeManager* treeManagerLocal = GetApzcTreeManager()) {
|
||||||
const FlingHandoffState handoffState{flingVelocity,
|
FlingHandoffState handoffState{flingVelocity,
|
||||||
GetCurrentTouchBlock()->GetOverscrollHandoffChain(),
|
GetCurrentTouchBlock()->GetOverscrollHandoffChain(),
|
||||||
false /* not handoff */,
|
false /* not handoff */,
|
||||||
GetCurrentTouchBlock()->GetScrolledApzc()};
|
GetCurrentTouchBlock()->GetScrolledApzc()};
|
||||||
treeManagerLocal->DispatchFling(this, handoffState);
|
treeManagerLocal->DispatchFling(this, handoffState);
|
||||||
}
|
}
|
||||||
return nsEventStatus_eConsumeNoDefault;
|
return nsEventStatus_eConsumeNoDefault;
|
||||||
@@ -1914,8 +1914,9 @@ AsyncPanZoomController::GetKeyboardDestination(const KeyboardScrollAction& aActi
|
|||||||
return scrollDestination;
|
return scrollDestination;
|
||||||
}
|
}
|
||||||
|
|
||||||
ParentLayerPoint
|
// Return whether or not the underlying layer can be scrolled on either axis.
|
||||||
AsyncPanZoomController::GetDeltaForEvent(const InputData& aEvent) const
|
bool
|
||||||
|
AsyncPanZoomController::CanScroll(const InputData& aEvent) const
|
||||||
{
|
{
|
||||||
ParentLayerPoint delta;
|
ParentLayerPoint delta;
|
||||||
if (aEvent.mInputType == SCROLLWHEEL_INPUT) {
|
if (aEvent.mInputType == SCROLLWHEEL_INPUT) {
|
||||||
@@ -1924,14 +1925,6 @@ AsyncPanZoomController::GetDeltaForEvent(const InputData& aEvent) const
|
|||||||
const PanGestureInput& panInput = aEvent.AsPanGestureInput();
|
const PanGestureInput& panInput = aEvent.AsPanGestureInput();
|
||||||
delta = ToParentLayerCoordinates(panInput.UserMultipliedPanDisplacement(), panInput.mPanStartPoint);
|
delta = ToParentLayerCoordinates(panInput.UserMultipliedPanDisplacement(), panInput.mPanStartPoint);
|
||||||
}
|
}
|
||||||
return delta;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Return whether or not the underlying layer can be scrolled on either axis.
|
|
||||||
bool
|
|
||||||
AsyncPanZoomController::CanScroll(const InputData& aEvent) const
|
|
||||||
{
|
|
||||||
ParentLayerPoint delta = GetDeltaForEvent(aEvent);
|
|
||||||
if (!delta.x && !delta.y) {
|
if (!delta.x && !delta.y) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1939,20 +1932,6 @@ AsyncPanZoomController::CanScroll(const InputData& aEvent) const
|
|||||||
return CanScrollWithWheel(delta);
|
return CanScrollWithWheel(delta);
|
||||||
}
|
}
|
||||||
|
|
||||||
ScrollDirections
|
|
||||||
AsyncPanZoomController::GetAllowedHandoffDirections() const
|
|
||||||
{
|
|
||||||
ScrollDirections result;
|
|
||||||
RecursiveMutexAutoLock lock(mRecursiveMutex);
|
|
||||||
if (mX.OverscrollBehaviorAllowsHandoff()) {
|
|
||||||
result += ScrollDirection::eHorizontal;
|
|
||||||
}
|
|
||||||
if (mY.OverscrollBehaviorAllowsHandoff()) {
|
|
||||||
result += ScrollDirection::eVertical;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
AsyncPanZoomController::CanScrollWithWheel(const ParentLayerPoint& aDelta) const
|
AsyncPanZoomController::CanScrollWithWheel(const ParentLayerPoint& aDelta) const
|
||||||
{
|
{
|
||||||
@@ -2020,19 +1999,6 @@ ScrollInputMethodForWheelDeltaType(ScrollWheelInput::ScrollDeltaType aDeltaType)
|
|||||||
return ScrollInputMethod::ApzWheelLine;
|
return ScrollInputMethod::ApzWheelLine;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
AdjustDeltaForAllowedScrollDirections(
|
|
||||||
ParentLayerPoint& aDelta,
|
|
||||||
const ScrollDirections& aAllowedScrollDirections)
|
|
||||||
{
|
|
||||||
if (!aAllowedScrollDirections.contains(ScrollDirection::eHorizontal)) {
|
|
||||||
aDelta.x = 0;
|
|
||||||
}
|
|
||||||
if (!aAllowedScrollDirections.contains(ScrollDirection::eVertical)) {
|
|
||||||
aDelta.y = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
nsEventStatus AsyncPanZoomController::OnScrollWheel(const ScrollWheelInput& aEvent)
|
nsEventStatus AsyncPanZoomController::OnScrollWheel(const ScrollWheelInput& aEvent)
|
||||||
{
|
{
|
||||||
ParentLayerPoint delta = GetScrollWheelDelta(aEvent);
|
ParentLayerPoint delta = GetScrollWheelDelta(aEvent);
|
||||||
@@ -2051,10 +2017,6 @@ nsEventStatus AsyncPanZoomController::OnScrollWheel(const ScrollWheelInput& aEve
|
|||||||
return nsEventStatus_eConsumeNoDefault;
|
return nsEventStatus_eConsumeNoDefault;
|
||||||
}
|
}
|
||||||
|
|
||||||
MOZ_ASSERT(mInputQueue->GetCurrentWheelBlock());
|
|
||||||
AdjustDeltaForAllowedScrollDirections(delta,
|
|
||||||
mInputQueue->GetCurrentWheelBlock()->GetAllowedScrollDirections());
|
|
||||||
|
|
||||||
if (delta.x == 0 && delta.y == 0) {
|
if (delta.x == 0 && delta.y == 0) {
|
||||||
// Avoid spurious state changes and unnecessary work
|
// Avoid spurious state changes and unnecessary work
|
||||||
return nsEventStatus_eIgnore;
|
return nsEventStatus_eIgnore;
|
||||||
@@ -2078,6 +2040,7 @@ nsEventStatus AsyncPanZoomController::OnScrollWheel(const ScrollWheelInput& aEve
|
|||||||
|
|
||||||
CancelAnimation();
|
CancelAnimation();
|
||||||
|
|
||||||
|
MOZ_ASSERT(mInputQueue->GetCurrentWheelBlock());
|
||||||
OverscrollHandoffState handoffState(
|
OverscrollHandoffState handoffState(
|
||||||
*mInputQueue->GetCurrentWheelBlock()->GetOverscrollHandoffChain(),
|
*mInputQueue->GetCurrentWheelBlock()->GetOverscrollHandoffChain(),
|
||||||
distance,
|
distance,
|
||||||
@@ -2254,10 +2217,6 @@ nsEventStatus AsyncPanZoomController::OnPan(const PanGestureInput& aEvent, bool
|
|||||||
ScreenPoint physicalPanDisplacement = aEvent.mPanDisplacement;
|
ScreenPoint physicalPanDisplacement = aEvent.mPanDisplacement;
|
||||||
ParentLayerPoint logicalPanDisplacement = aEvent.UserMultipliedLocalPanDisplacement();
|
ParentLayerPoint logicalPanDisplacement = aEvent.UserMultipliedLocalPanDisplacement();
|
||||||
|
|
||||||
MOZ_ASSERT(GetCurrentPanGestureBlock());
|
|
||||||
AdjustDeltaForAllowedScrollDirections(logicalPanDisplacement,
|
|
||||||
GetCurrentPanGestureBlock()->GetAllowedScrollDirections());
|
|
||||||
|
|
||||||
// We need to update the axis velocity in order to get a useful display port
|
// We need to update the axis velocity in order to get a useful display port
|
||||||
// size and position. We need to do so even if this is a momentum pan (i.e.
|
// size and position. We need to do so even if this is a momentum pan (i.e.
|
||||||
// aFingersOnTouchpad == false); in that case the "with touch" part is not
|
// aFingersOnTouchpad == false); in that case the "with touch" part is not
|
||||||
@@ -2271,6 +2230,7 @@ nsEventStatus AsyncPanZoomController::OnPan(const PanGestureInput& aEvent, bool
|
|||||||
(uint32_t) ScrollInputMethod::ApzPanGesture);
|
(uint32_t) ScrollInputMethod::ApzPanGesture);
|
||||||
|
|
||||||
ScreenPoint panDistance(fabs(physicalPanDisplacement.x), fabs(physicalPanDisplacement.y));
|
ScreenPoint panDistance(fabs(physicalPanDisplacement.x), fabs(physicalPanDisplacement.y));
|
||||||
|
MOZ_ASSERT(GetCurrentPanGestureBlock());
|
||||||
OverscrollHandoffState handoffState(
|
OverscrollHandoffState handoffState(
|
||||||
*GetCurrentPanGestureBlock()->GetOverscrollHandoffChain(),
|
*GetCurrentPanGestureBlock()->GetOverscrollHandoffChain(),
|
||||||
panDistance,
|
panDistance,
|
||||||
@@ -2809,8 +2769,8 @@ void AsyncPanZoomController::OverscrollBy(ParentLayerPoint& aOverscroll) {
|
|||||||
bool xConsumed = FuzzyEqualsAdditive(aOverscroll.x, 0.0f, COORDINATE_EPSILON);
|
bool xConsumed = FuzzyEqualsAdditive(aOverscroll.x, 0.0f, COORDINATE_EPSILON);
|
||||||
bool yConsumed = FuzzyEqualsAdditive(aOverscroll.y, 0.0f, COORDINATE_EPSILON);
|
bool yConsumed = FuzzyEqualsAdditive(aOverscroll.y, 0.0f, COORDINATE_EPSILON);
|
||||||
|
|
||||||
bool shouldOverscrollX = xCanScroll && !xConsumed && mX.OverscrollBehaviorAllowsOverscrollEffect();
|
bool shouldOverscrollX = xCanScroll && !xConsumed;
|
||||||
bool shouldOverscrollY = yCanScroll && !yConsumed && mY.OverscrollBehaviorAllowsOverscrollEffect();
|
bool shouldOverscrollY = yCanScroll && !yConsumed;
|
||||||
|
|
||||||
mOverscrollEffect->ConsumeOverscroll(aOverscroll, shouldOverscrollX, shouldOverscrollY);
|
mOverscrollEffect->ConsumeOverscroll(aOverscroll, shouldOverscrollX, shouldOverscrollY);
|
||||||
}
|
}
|
||||||
@@ -2827,25 +2787,20 @@ RefPtr<const OverscrollHandoffChain> AsyncPanZoomController::BuildOverscrollHand
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
ParentLayerPoint AsyncPanZoomController::AttemptFling(const FlingHandoffState& aHandoffState) {
|
void AsyncPanZoomController::AcceptFling(FlingHandoffState& aHandoffState) {
|
||||||
RecursiveMutexAutoLock lock(mRecursiveMutex);
|
RecursiveMutexAutoLock lock(mRecursiveMutex);
|
||||||
|
|
||||||
if (!IsPannable()) {
|
|
||||||
return aHandoffState.mVelocity;
|
|
||||||
}
|
|
||||||
|
|
||||||
// We may have a pre-existing velocity for whatever reason (for example,
|
// We may have a pre-existing velocity for whatever reason (for example,
|
||||||
// a previously handed off fling). We don't want to clobber that.
|
// a previously handed off fling). We don't want to clobber that.
|
||||||
APZC_LOG("%p accepting fling with velocity %s\n", this,
|
APZC_LOG("%p accepting fling with velocity %s\n", this,
|
||||||
Stringify(aHandoffState.mVelocity).c_str());
|
Stringify(aHandoffState.mVelocity).c_str());
|
||||||
ParentLayerPoint residualVelocity = aHandoffState.mVelocity;
|
|
||||||
if (mX.CanScroll()) {
|
if (mX.CanScroll()) {
|
||||||
mX.SetVelocity(mX.GetVelocity() + aHandoffState.mVelocity.x);
|
mX.SetVelocity(mX.GetVelocity() + aHandoffState.mVelocity.x);
|
||||||
residualVelocity.x = 0;
|
aHandoffState.mVelocity.x = 0;
|
||||||
}
|
}
|
||||||
if (mY.CanScroll()) {
|
if (mY.CanScroll()) {
|
||||||
mY.SetVelocity(mY.GetVelocity() + aHandoffState.mVelocity.y);
|
mY.SetVelocity(mY.GetVelocity() + aHandoffState.mVelocity.y);
|
||||||
residualVelocity.y = 0;
|
aHandoffState.mVelocity.y = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If there's a scroll snap point near the predicted fling destination,
|
// If there's a scroll snap point near the predicted fling destination,
|
||||||
@@ -2861,30 +2816,16 @@ ParentLayerPoint AsyncPanZoomController::AttemptFling(const FlingHandoffState& a
|
|||||||
aHandoffState.mScrolledApzc);
|
aHandoffState.mScrolledApzc);
|
||||||
StartAnimation(fling);
|
StartAnimation(fling);
|
||||||
}
|
}
|
||||||
|
|
||||||
return residualVelocity;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ParentLayerPoint AsyncPanZoomController::AdjustHandoffVelocityForOverscrollBehavior(ParentLayerPoint& aHandoffVelocity) const
|
bool AsyncPanZoomController::AttemptFling(FlingHandoffState& aHandoffState) {
|
||||||
{
|
// If we are pannable, take over the fling ourselves.
|
||||||
RecursiveMutexAutoLock lock(mRecursiveMutex);
|
if (IsPannable()) {
|
||||||
ParentLayerPoint residualVelocity;
|
AcceptFling(aHandoffState);
|
||||||
if (!mX.OverscrollBehaviorAllowsHandoff()) {
|
return true;
|
||||||
residualVelocity.x = aHandoffVelocity.x;
|
|
||||||
aHandoffVelocity.x = 0;
|
|
||||||
}
|
}
|
||||||
if (!mY.OverscrollBehaviorAllowsHandoff()) {
|
|
||||||
residualVelocity.y = aHandoffVelocity.y;
|
|
||||||
aHandoffVelocity.y = 0;
|
|
||||||
}
|
|
||||||
return residualVelocity;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AsyncPanZoomController::OverscrollBehaviorAllowsSwipe() const
|
return false;
|
||||||
{
|
|
||||||
RecursiveMutexAutoLock lock(mRecursiveMutex);
|
|
||||||
// Swipe navigation is a "non-local" overscroll behavior like handoff.
|
|
||||||
return mX.OverscrollBehaviorAllowsHandoff();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AsyncPanZoomController::HandleFlingOverscroll(const ParentLayerPoint& aVelocity,
|
void AsyncPanZoomController::HandleFlingOverscroll(const ParentLayerPoint& aVelocity,
|
||||||
@@ -2892,24 +2833,13 @@ void AsyncPanZoomController::HandleFlingOverscroll(const ParentLayerPoint& aVelo
|
|||||||
const RefPtr<const AsyncPanZoomController>& aScrolledApzc) {
|
const RefPtr<const AsyncPanZoomController>& aScrolledApzc) {
|
||||||
APZCTreeManager* treeManagerLocal = GetApzcTreeManager();
|
APZCTreeManager* treeManagerLocal = GetApzcTreeManager();
|
||||||
if (treeManagerLocal) {
|
if (treeManagerLocal) {
|
||||||
const FlingHandoffState handoffState{aVelocity,
|
FlingHandoffState handoffState{aVelocity,
|
||||||
aOverscrollHandoffChain,
|
aOverscrollHandoffChain,
|
||||||
true /* handoff */,
|
true /* handoff */,
|
||||||
aScrolledApzc};
|
aScrolledApzc};
|
||||||
ParentLayerPoint residualVelocity = treeManagerLocal->DispatchFling(this, handoffState);
|
treeManagerLocal->DispatchFling(this, handoffState);
|
||||||
if (!IsZero(residualVelocity) && IsPannable() && gfxPrefs::APZOverscrollEnabled()) {
|
if (!IsZero(handoffState.mVelocity) && IsPannable() && gfxPrefs::APZOverscrollEnabled()) {
|
||||||
// Obey overscroll-behavior.
|
mOverscrollEffect->HandleFlingOverscroll(handoffState.mVelocity);
|
||||||
RecursiveMutexAutoLock lock(mRecursiveMutex);
|
|
||||||
if (!mX.OverscrollBehaviorAllowsOverscrollEffect()) {
|
|
||||||
residualVelocity.x = 0;
|
|
||||||
}
|
|
||||||
if (!mY.OverscrollBehaviorAllowsOverscrollEffect()) {
|
|
||||||
residualVelocity.y = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!IsZero(residualVelocity)) {
|
|
||||||
mOverscrollEffect->HandleFlingOverscroll(residualVelocity);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2963,25 +2893,8 @@ void AsyncPanZoomController::CallDispatchScroll(ParentLayerPoint& aStartPoint,
|
|||||||
if (!treeManagerLocal) {
|
if (!treeManagerLocal) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Obey overscroll-behavior.
|
|
||||||
ParentLayerPoint endPoint = aEndPoint;
|
|
||||||
if (aOverscrollHandoffState.mChainIndex > 0) {
|
|
||||||
RecursiveMutexAutoLock lock(mRecursiveMutex);
|
|
||||||
if (!mX.OverscrollBehaviorAllowsHandoff()) {
|
|
||||||
endPoint.x = aStartPoint.x;
|
|
||||||
}
|
|
||||||
if (!mY.OverscrollBehaviorAllowsHandoff()) {
|
|
||||||
endPoint.y = aStartPoint.y;
|
|
||||||
}
|
|
||||||
if (aStartPoint == endPoint) {
|
|
||||||
// Handoff not allowed in either direction - don't even bother.
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
treeManagerLocal->DispatchScroll(this,
|
treeManagerLocal->DispatchScroll(this,
|
||||||
aStartPoint, endPoint,
|
aStartPoint, aEndPoint,
|
||||||
aOverscrollHandoffState);
|
aOverscrollHandoffState);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3946,7 +3859,6 @@ void AsyncPanZoomController::NotifyLayersUpdated(const ScrollMetadata& aScrollMe
|
|||||||
mScrollMetadata.SetUsesContainerScrolling(aScrollMetadata.UsesContainerScrolling());
|
mScrollMetadata.SetUsesContainerScrolling(aScrollMetadata.UsesContainerScrolling());
|
||||||
mFrameMetrics.SetIsScrollInfoLayer(aLayerMetrics.IsScrollInfoLayer());
|
mFrameMetrics.SetIsScrollInfoLayer(aLayerMetrics.IsScrollInfoLayer());
|
||||||
mScrollMetadata.SetForceDisableApz(aScrollMetadata.IsApzForceDisabled());
|
mScrollMetadata.SetForceDisableApz(aScrollMetadata.IsApzForceDisabled());
|
||||||
mScrollMetadata.SetOverscrollBehavior(aScrollMetadata.GetOverscrollBehavior());
|
|
||||||
|
|
||||||
if (scrollOffsetUpdated) {
|
if (scrollOffsetUpdated) {
|
||||||
APZC_LOG("%p updating scroll offset from %s to %s\n", this,
|
APZC_LOG("%p updating scroll offset from %s to %s\n", this,
|
||||||
@@ -4016,11 +3928,6 @@ const FrameMetrics& AsyncPanZoomController::GetFrameMetrics() const {
|
|||||||
return mFrameMetrics;
|
return mFrameMetrics;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ScrollMetadata& AsyncPanZoomController::GetScrollMetadata() const {
|
|
||||||
mRecursiveMutex.AssertCurrentThreadIn();
|
|
||||||
return mScrollMetadata;
|
|
||||||
}
|
|
||||||
|
|
||||||
APZCTreeManager* AsyncPanZoomController::GetApzcTreeManager() const {
|
APZCTreeManager* AsyncPanZoomController::GetApzcTreeManager() const {
|
||||||
mRecursiveMutex.AssertNotCurrentThreadIn();
|
mRecursiveMutex.AssertNotCurrentThreadIn();
|
||||||
return mTreeManager;
|
return mTreeManager;
|
||||||
|
|||||||
@@ -420,10 +420,6 @@ public:
|
|||||||
// direction.
|
// direction.
|
||||||
bool CanScroll(const InputData& aEvent) const;
|
bool CanScroll(const InputData& aEvent) const;
|
||||||
|
|
||||||
// Return the directions in which this APZC allows handoff (as governed by
|
|
||||||
// overscroll-behavior).
|
|
||||||
ScrollDirections GetAllowedHandoffDirections() const;
|
|
||||||
|
|
||||||
// Return whether or not a scroll delta will be able to scroll in either
|
// Return whether or not a scroll delta will be able to scroll in either
|
||||||
// direction.
|
// direction.
|
||||||
bool CanScrollWithWheel(const ParentLayerPoint& aDelta) const;
|
bool CanScrollWithWheel(const ParentLayerPoint& aDelta) const;
|
||||||
@@ -442,8 +438,6 @@ public:
|
|||||||
|
|
||||||
void NotifyMozMouseScrollEvent(const nsString& aString) const;
|
void NotifyMozMouseScrollEvent(const nsString& aString) const;
|
||||||
|
|
||||||
bool OverscrollBehaviorAllowsSwipe() const;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Protected destructor, to discourage deletion outside of Release():
|
// Protected destructor, to discourage deletion outside of Release():
|
||||||
virtual ~AsyncPanZoomController();
|
virtual ~AsyncPanZoomController();
|
||||||
@@ -674,12 +668,6 @@ protected:
|
|||||||
*/
|
*/
|
||||||
const FrameMetrics& GetFrameMetrics() const;
|
const FrameMetrics& GetFrameMetrics() const;
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the current scroll metadata. This is *not* the Gecko copy stored in
|
|
||||||
* the layers code/
|
|
||||||
*/
|
|
||||||
const ScrollMetadata& GetScrollMetadata() const;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the pointer to the apzc tree manager. All the access to tree manager
|
* Gets the pointer to the apzc tree manager. All the access to tree manager
|
||||||
* should be made via this method and not via private variable since this method
|
* should be made via this method and not via private variable since this method
|
||||||
@@ -1008,16 +996,16 @@ private:
|
|||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* Attempt a fling with the velocity specified in |aHandoffState|.
|
* Attempt a fling with the velocity specified in |aHandoffState|.
|
||||||
|
* If we are not pannable, the fling is handed off to the next APZC in
|
||||||
|
* the handoff chain via mTreeManager->DispatchFling().
|
||||||
|
* Returns true iff. the entire velocity of the fling was consumed by
|
||||||
|
* this APZC. |aHandoffState.mVelocity| is modified to contain any
|
||||||
|
* unused, residual velocity.
|
||||||
* |aHandoffState.mIsHandoff| should be true iff. the fling was handed off
|
* |aHandoffState.mIsHandoff| should be true iff. the fling was handed off
|
||||||
* from a previous APZC, and determines whether acceleration is applied
|
* from a previous APZC, and determines whether acceleration is applied
|
||||||
* to the fling.
|
* to the fling.
|
||||||
* We only accept the fling in the direction(s) in which we are pannable.
|
|
||||||
* Returns the "residual velocity", i.e. the portion of
|
|
||||||
* |aHandoffState.mVelocity| that this APZC did not consume.
|
|
||||||
*/
|
*/
|
||||||
ParentLayerPoint AttemptFling(const FlingHandoffState& aHandoffState);
|
bool AttemptFling(FlingHandoffState& aHandoffState);
|
||||||
|
|
||||||
ParentLayerPoint AdjustHandoffVelocityForOverscrollBehavior(ParentLayerPoint& aHandoffVelocity) const;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class AndroidFlingAnimation;
|
friend class AndroidFlingAnimation;
|
||||||
@@ -1050,6 +1038,9 @@ private:
|
|||||||
|
|
||||||
void HandleSmoothScrollOverscroll(const ParentLayerPoint& aVelocity);
|
void HandleSmoothScrollOverscroll(const ParentLayerPoint& aVelocity);
|
||||||
|
|
||||||
|
// Helper function used by AttemptFling().
|
||||||
|
void AcceptFling(FlingHandoffState& aHandoffState);
|
||||||
|
|
||||||
// Start an overscroll animation with the given initial velocity.
|
// Start an overscroll animation with the given initial velocity.
|
||||||
void StartOverscrollAnimation(const ParentLayerPoint& aVelocity);
|
void StartOverscrollAnimation(const ParentLayerPoint& aVelocity);
|
||||||
|
|
||||||
@@ -1188,8 +1179,6 @@ private:
|
|||||||
*/
|
*/
|
||||||
void OverscrollBy(ParentLayerPoint& aOverscroll);
|
void OverscrollBy(ParentLayerPoint& aOverscroll);
|
||||||
|
|
||||||
// Helper function for CanScroll().
|
|
||||||
ParentLayerPoint GetDeltaForEvent(const InputData& aEvent) const;
|
|
||||||
|
|
||||||
/* ===================================================================
|
/* ===================================================================
|
||||||
* The functions and members in this section are used to maintain the
|
* The functions and members in this section are used to maintain the
|
||||||
|
|||||||
@@ -491,21 +491,6 @@ const FrameMetrics& Axis::GetFrameMetrics() const {
|
|||||||
return mAsyncPanZoomController->GetFrameMetrics();
|
return mAsyncPanZoomController->GetFrameMetrics();
|
||||||
}
|
}
|
||||||
|
|
||||||
const ScrollMetadata& Axis::GetScrollMetadata() const {
|
|
||||||
return mAsyncPanZoomController->GetScrollMetadata();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Axis::OverscrollBehaviorAllowsHandoff() const {
|
|
||||||
// Scroll handoff is a "non-local" overscroll behavior, so it's allowed
|
|
||||||
// with "auto" and disallowed with "contain" and "none".
|
|
||||||
return GetOverscrollBehavior() == OverscrollBehavior::Auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Axis::OverscrollBehaviorAllowsOverscrollEffect() const {
|
|
||||||
// An overscroll effect is a "local" overscroll behavior, so it's allowed
|
|
||||||
// with "auto" and "contain" and disallowed with "none".
|
|
||||||
return GetOverscrollBehavior() != OverscrollBehavior::None;
|
|
||||||
}
|
|
||||||
|
|
||||||
AxisX::AxisX(AsyncPanZoomController* aAsyncPanZoomController)
|
AxisX::AxisX(AsyncPanZoomController* aAsyncPanZoomController)
|
||||||
: Axis(aAsyncPanZoomController)
|
: Axis(aAsyncPanZoomController)
|
||||||
@@ -543,11 +528,6 @@ const char* AxisX::Name() const
|
|||||||
return "X";
|
return "X";
|
||||||
}
|
}
|
||||||
|
|
||||||
OverscrollBehavior AxisX::GetOverscrollBehavior() const
|
|
||||||
{
|
|
||||||
return GetScrollMetadata().GetOverscrollBehavior().mBehaviorX;
|
|
||||||
}
|
|
||||||
|
|
||||||
AxisY::AxisY(AsyncPanZoomController* aAsyncPanZoomController)
|
AxisY::AxisY(AsyncPanZoomController* aAsyncPanZoomController)
|
||||||
: Axis(aAsyncPanZoomController)
|
: Axis(aAsyncPanZoomController)
|
||||||
{
|
{
|
||||||
@@ -584,10 +564,5 @@ const char* AxisY::Name() const
|
|||||||
return "Y";
|
return "Y";
|
||||||
}
|
}
|
||||||
|
|
||||||
OverscrollBehavior AxisY::GetOverscrollBehavior() const
|
|
||||||
{
|
|
||||||
return GetScrollMetadata().GetOverscrollBehavior().mBehaviorY;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace layers
|
} // namespace layers
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|||||||
@@ -249,9 +249,6 @@ public:
|
|||||||
|
|
||||||
ParentLayerCoord GetPos() const { return mPos; }
|
ParentLayerCoord GetPos() const { return mPos; }
|
||||||
|
|
||||||
bool OverscrollBehaviorAllowsHandoff() const;
|
|
||||||
bool OverscrollBehaviorAllowsOverscrollEffect() const;
|
|
||||||
|
|
||||||
virtual ParentLayerCoord GetPointOffset(const ParentLayerPoint& aPoint) const = 0;
|
virtual ParentLayerCoord GetPointOffset(const ParentLayerPoint& aPoint) const = 0;
|
||||||
virtual ParentLayerCoord GetRectLength(const ParentLayerRect& aRect) const = 0;
|
virtual ParentLayerCoord GetRectLength(const ParentLayerRect& aRect) const = 0;
|
||||||
virtual ParentLayerCoord GetRectOffset(const ParentLayerRect& aRect) const = 0;
|
virtual ParentLayerCoord GetRectOffset(const ParentLayerRect& aRect) const = 0;
|
||||||
@@ -289,9 +286,6 @@ protected:
|
|||||||
nsTArray<std::pair<uint32_t, float> > mVelocityQueue;
|
nsTArray<std::pair<uint32_t, float> > mVelocityQueue;
|
||||||
|
|
||||||
const FrameMetrics& GetFrameMetrics() const;
|
const FrameMetrics& GetFrameMetrics() const;
|
||||||
const ScrollMetadata& GetScrollMetadata() const;
|
|
||||||
|
|
||||||
virtual OverscrollBehavior GetOverscrollBehavior() const = 0;
|
|
||||||
|
|
||||||
// Adjust a requested overscroll amount for resistance, yielding a smaller
|
// Adjust a requested overscroll amount for resistance, yielding a smaller
|
||||||
// actual overscroll amount.
|
// actual overscroll amount.
|
||||||
@@ -313,8 +307,6 @@ public:
|
|||||||
virtual CSSToParentLayerScale GetScaleForAxis(const CSSToParentLayerScale2D& aScale) const override;
|
virtual CSSToParentLayerScale GetScaleForAxis(const CSSToParentLayerScale2D& aScale) const override;
|
||||||
virtual ScreenPoint MakePoint(ScreenCoord aCoord) const override;
|
virtual ScreenPoint MakePoint(ScreenCoord aCoord) const override;
|
||||||
virtual const char* Name() const override;
|
virtual const char* Name() const override;
|
||||||
private:
|
|
||||||
virtual OverscrollBehavior GetOverscrollBehavior() const override;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class AxisY : public Axis {
|
class AxisY : public Axis {
|
||||||
@@ -326,8 +318,6 @@ public:
|
|||||||
virtual CSSToParentLayerScale GetScaleForAxis(const CSSToParentLayerScale2D& aScale) const override;
|
virtual CSSToParentLayerScale GetScaleForAxis(const CSSToParentLayerScale2D& aScale) const override;
|
||||||
virtual ScreenPoint MakePoint(ScreenCoord aCoord) const override;
|
virtual ScreenPoint MakePoint(ScreenCoord aCoord) const override;
|
||||||
virtual const char* Name() const override;
|
virtual const char* Name() const override;
|
||||||
private:
|
|
||||||
virtual OverscrollBehavior GetOverscrollBehavior() const override;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace layers
|
} // namespace layers
|
||||||
|
|||||||
@@ -322,8 +322,7 @@ WheelBlockState::WheelBlockState(const RefPtr<AsyncPanZoomController>& aTargetAp
|
|||||||
// content should have found a scrollable apzc, so we don't need to handle
|
// content should have found a scrollable apzc, so we don't need to handle
|
||||||
// that case.
|
// that case.
|
||||||
RefPtr<AsyncPanZoomController> apzc =
|
RefPtr<AsyncPanZoomController> apzc =
|
||||||
mOverscrollHandoffChain->FindFirstScrollable(
|
mOverscrollHandoffChain->FindFirstScrollable(aInitialEvent);
|
||||||
aInitialEvent, &mAllowedScrollDirections);
|
|
||||||
|
|
||||||
// If nothing is scrollable, we don't consider this block as starting a
|
// If nothing is scrollable, we don't consider this block as starting a
|
||||||
// transaction.
|
// transaction.
|
||||||
@@ -357,8 +356,7 @@ WheelBlockState::SetConfirmedTargetApzc(const RefPtr<AsyncPanZoomController>& aT
|
|||||||
// one by looking for the first apzc the next pending event can scroll.
|
// one by looking for the first apzc the next pending event can scroll.
|
||||||
RefPtr<AsyncPanZoomController> apzc = aTargetApzc;
|
RefPtr<AsyncPanZoomController> apzc = aTargetApzc;
|
||||||
if (apzc && aFirstInput) {
|
if (apzc && aFirstInput) {
|
||||||
apzc = apzc->BuildOverscrollHandoffChain()->FindFirstScrollable(
|
apzc = apzc->BuildOverscrollHandoffChain()->FindFirstScrollable(*aFirstInput);
|
||||||
*aFirstInput, &mAllowedScrollDirections);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
InputBlockState::SetConfirmedTargetApzc(apzc, aState, aFirstInput);
|
InputBlockState::SetConfirmedTargetApzc(apzc, aState, aFirstInput);
|
||||||
@@ -555,8 +553,7 @@ PanGestureBlockState::PanGestureBlockState(const RefPtr<AsyncPanZoomController>&
|
|||||||
// content should have found a scrollable apzc, so we don't need to handle
|
// content should have found a scrollable apzc, so we don't need to handle
|
||||||
// that case.
|
// that case.
|
||||||
RefPtr<AsyncPanZoomController> apzc =
|
RefPtr<AsyncPanZoomController> apzc =
|
||||||
mOverscrollHandoffChain->FindFirstScrollable(
|
mOverscrollHandoffChain->FindFirstScrollable(aInitialEvent);
|
||||||
aInitialEvent, &mAllowedScrollDirections);
|
|
||||||
|
|
||||||
if (apzc && apzc != GetTargetApzc()) {
|
if (apzc && apzc != GetTargetApzc()) {
|
||||||
UpdateTargetApzc(apzc);
|
UpdateTargetApzc(apzc);
|
||||||
@@ -575,8 +572,7 @@ PanGestureBlockState::SetConfirmedTargetApzc(const RefPtr<AsyncPanZoomController
|
|||||||
RefPtr<AsyncPanZoomController> apzc = aTargetApzc;
|
RefPtr<AsyncPanZoomController> apzc = aTargetApzc;
|
||||||
if (apzc && aFirstInput) {
|
if (apzc && aFirstInput) {
|
||||||
RefPtr<AsyncPanZoomController> scrollableApzc =
|
RefPtr<AsyncPanZoomController> scrollableApzc =
|
||||||
apzc->BuildOverscrollHandoffChain()->FindFirstScrollable(
|
apzc->BuildOverscrollHandoffChain()->FindFirstScrollable(*aFirstInput);
|
||||||
*aFirstInput, &mAllowedScrollDirections);
|
|
||||||
if (scrollableApzc) {
|
if (scrollableApzc) {
|
||||||
apzc = scrollableApzc;
|
apzc = scrollableApzc;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -282,8 +282,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
void Update(ScrollWheelInput& aEvent);
|
void Update(ScrollWheelInput& aEvent);
|
||||||
|
|
||||||
ScrollDirections GetAllowedScrollDirections() const { return mAllowedScrollDirections; }
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void UpdateTargetApzc(const RefPtr<AsyncPanZoomController>& aTargetApzc) override;
|
void UpdateTargetApzc(const RefPtr<AsyncPanZoomController>& aTargetApzc) override;
|
||||||
|
|
||||||
@@ -292,7 +290,6 @@ private:
|
|||||||
TimeStamp mLastMouseMove;
|
TimeStamp mLastMouseMove;
|
||||||
uint32_t mScrollSeriesCounter;
|
uint32_t mScrollSeriesCounter;
|
||||||
bool mTransactionEnded;
|
bool mTransactionEnded;
|
||||||
ScrollDirections mAllowedScrollDirections;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -357,12 +354,9 @@ public:
|
|||||||
|
|
||||||
void SetNeedsToWaitForContentResponse(bool aWaitForContentResponse);
|
void SetNeedsToWaitForContentResponse(bool aWaitForContentResponse);
|
||||||
|
|
||||||
ScrollDirections GetAllowedScrollDirections() const { return mAllowedScrollDirections; }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool mInterrupted;
|
bool mInterrupted;
|
||||||
bool mWaitingForContentResponse;
|
bool mWaitingForContentResponse;
|
||||||
ScrollDirections mAllowedScrollDirections;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -318,13 +318,9 @@ CanScrollTargetHorizontally(const PanGestureInput& aInitialEvent,
|
|||||||
{
|
{
|
||||||
PanGestureInput horizontalComponent = aInitialEvent;
|
PanGestureInput horizontalComponent = aInitialEvent;
|
||||||
horizontalComponent.mPanDisplacement.y = 0;
|
horizontalComponent.mPanDisplacement.y = 0;
|
||||||
ScrollDirections allowedScrollDirections;
|
|
||||||
RefPtr<AsyncPanZoomController> horizontallyScrollableAPZC =
|
RefPtr<AsyncPanZoomController> horizontallyScrollableAPZC =
|
||||||
aBlock->GetOverscrollHandoffChain()->FindFirstScrollable(
|
aBlock->GetOverscrollHandoffChain()->FindFirstScrollable(horizontalComponent);
|
||||||
horizontalComponent, &allowedScrollDirections);
|
return horizontallyScrollableAPZC && horizontallyScrollableAPZC == aBlock->GetTargetApzc();
|
||||||
return horizontallyScrollableAPZC &&
|
|
||||||
horizontallyScrollableAPZC == aBlock->GetTargetApzc() &&
|
|
||||||
allowedScrollDirections.contains(ScrollDirection::eHorizontal);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nsEventStatus
|
nsEventStatus
|
||||||
|
|||||||
@@ -161,24 +161,12 @@ OverscrollHandoffChain::HasFastFlungApzc() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
RefPtr<AsyncPanZoomController>
|
RefPtr<AsyncPanZoomController>
|
||||||
OverscrollHandoffChain::FindFirstScrollable(
|
OverscrollHandoffChain::FindFirstScrollable(const InputData& aInput) const
|
||||||
const InputData& aInput,
|
|
||||||
ScrollDirections* aOutAllowedScrollDirections) const
|
|
||||||
{
|
{
|
||||||
// Start by allowing scrolling in both directions. As we do handoff
|
|
||||||
// overscroll-behavior may restrict one or both of the directions.
|
|
||||||
*aOutAllowedScrollDirections += ScrollDirection::eVertical;
|
|
||||||
*aOutAllowedScrollDirections += ScrollDirection::eHorizontal;
|
|
||||||
|
|
||||||
for (size_t i = 0; i < Length(); i++) {
|
for (size_t i = 0; i < Length(); i++) {
|
||||||
if (mChain[i]->CanScroll(aInput)) {
|
if (mChain[i]->CanScroll(aInput)) {
|
||||||
return mChain[i];
|
return mChain[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
*aOutAllowedScrollDirections &= mChain[i]->GetAllowedHandoffDirections();
|
|
||||||
if (aOutAllowedScrollDirections->isEmpty()) {
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,13 +89,7 @@ public:
|
|||||||
// Determine whether any APZC along this handoff chain has been flung fast.
|
// Determine whether any APZC along this handoff chain has been flung fast.
|
||||||
bool HasFastFlungApzc() const;
|
bool HasFastFlungApzc() const;
|
||||||
|
|
||||||
// Find the first APZC in this handoff chain that can be scrolled by |aInput|.
|
RefPtr<AsyncPanZoomController> FindFirstScrollable(const InputData& aInput) const;
|
||||||
// Since overscroll-behavior can restrict handoff in some directions,
|
|
||||||
// |aOutAllowedScrollDirections| is populated with the scroll directions
|
|
||||||
// in which scrolling of the returned APZC is allowed.
|
|
||||||
RefPtr<AsyncPanZoomController> FindFirstScrollable(
|
|
||||||
const InputData& aInput,
|
|
||||||
ScrollDirections* aOutAllowedScrollDirections) const;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<RefPtr<AsyncPanZoomController>> mChain;
|
std::vector<RefPtr<AsyncPanZoomController>> mChain;
|
||||||
|
|||||||
@@ -78,14 +78,6 @@ struct ParamTraits<mozilla::layers::FrameMetrics::ScrollOffsetUpdateType>
|
|||||||
mozilla::layers::FrameMetrics::sHighestScrollOffsetUpdateType>
|
mozilla::layers::FrameMetrics::sHighestScrollOffsetUpdateType>
|
||||||
{};
|
{};
|
||||||
|
|
||||||
template <>
|
|
||||||
struct ParamTraits<mozilla::layers::OverscrollBehavior>
|
|
||||||
: public ContiguousEnumSerializerInclusive<
|
|
||||||
mozilla::layers::OverscrollBehavior,
|
|
||||||
mozilla::layers::OverscrollBehavior::Auto,
|
|
||||||
mozilla::layers::kHighestOverscrollBehavior>
|
|
||||||
{};
|
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
struct ParamTraits<mozilla::layers::LayerHandle>
|
struct ParamTraits<mozilla::layers::LayerHandle>
|
||||||
{
|
{
|
||||||
@@ -232,27 +224,6 @@ struct ParamTraits<mozilla::layers::ScrollSnapInfo>
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
|
||||||
struct ParamTraits<mozilla::layers::OverscrollBehaviorInfo>
|
|
||||||
{
|
|
||||||
// Not using PlainOldDataSerializer so we get enum validation
|
|
||||||
// for the members.
|
|
||||||
|
|
||||||
typedef mozilla::layers::OverscrollBehaviorInfo paramType;
|
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam)
|
|
||||||
{
|
|
||||||
WriteParam(aMsg, aParam.mBehaviorX);
|
|
||||||
WriteParam(aMsg, aParam.mBehaviorY);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
|
|
||||||
{
|
|
||||||
return (ReadParam(aMsg, aIter, &aResult->mBehaviorX) &&
|
|
||||||
ReadParam(aMsg, aIter, &aResult->mBehaviorY));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct ParamTraits<mozilla::layers::LayerClip>
|
struct ParamTraits<mozilla::layers::LayerClip>
|
||||||
{
|
{
|
||||||
@@ -292,7 +263,6 @@ struct ParamTraits<mozilla::layers::ScrollMetadata>
|
|||||||
WriteParam(aMsg, aParam.mIsLayersIdRoot);
|
WriteParam(aMsg, aParam.mIsLayersIdRoot);
|
||||||
WriteParam(aMsg, aParam.mUsesContainerScrolling);
|
WriteParam(aMsg, aParam.mUsesContainerScrolling);
|
||||||
WriteParam(aMsg, aParam.mForceDisableApz);
|
WriteParam(aMsg, aParam.mForceDisableApz);
|
||||||
WriteParam(aMsg, aParam.mOverscrollBehavior);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool ReadContentDescription(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
|
static bool ReadContentDescription(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
|
||||||
@@ -319,8 +289,7 @@ struct ParamTraits<mozilla::layers::ScrollMetadata>
|
|||||||
ReadBoolForBitfield(aMsg, aIter, aResult, ¶mType::SetAllowVerticalScrollWithWheel) &&
|
ReadBoolForBitfield(aMsg, aIter, aResult, ¶mType::SetAllowVerticalScrollWithWheel) &&
|
||||||
ReadBoolForBitfield(aMsg, aIter, aResult, ¶mType::SetIsLayersIdRoot) &&
|
ReadBoolForBitfield(aMsg, aIter, aResult, ¶mType::SetIsLayersIdRoot) &&
|
||||||
ReadBoolForBitfield(aMsg, aIter, aResult, ¶mType::SetUsesContainerScrolling) &&
|
ReadBoolForBitfield(aMsg, aIter, aResult, ¶mType::SetUsesContainerScrolling) &&
|
||||||
ReadBoolForBitfield(aMsg, aIter, aResult, ¶mType::SetForceDisableApz) &&
|
ReadBoolForBitfield(aMsg, aIter, aResult, ¶mType::SetForceDisableApz));
|
||||||
ReadParam(aMsg, aIter, &aResult->mOverscrollBehavior));
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -256,11 +256,6 @@ struct BitFlagsEnumSerializer
|
|||||||
* structure's members.
|
* structure's members.
|
||||||
*
|
*
|
||||||
* Derive ParamTraits<T> from PlainOldDataSerializer<T> if T is POD.
|
* Derive ParamTraits<T> from PlainOldDataSerializer<T> if T is POD.
|
||||||
*
|
|
||||||
* Note: For POD structures with enumeration fields, this will not do
|
|
||||||
* validation of the enum values the way serializing the fields
|
|
||||||
* individually would. Prefer serializing the fields individually
|
|
||||||
* in such cases.
|
|
||||||
*/
|
*/
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct PlainOldDataSerializer
|
struct PlainOldDataSerializer
|
||||||
|
|||||||
@@ -13,8 +13,6 @@ namespace mozilla {
|
|||||||
const nsStyleDisplay* aDisplay)
|
const nsStyleDisplay* aDisplay)
|
||||||
: mHorizontal(aH), mVertical(aV),
|
: mHorizontal(aH), mVertical(aV),
|
||||||
mScrollBehavior(aDisplay->mScrollBehavior),
|
mScrollBehavior(aDisplay->mScrollBehavior),
|
||||||
mOverscrollBehaviorX(aDisplay->mOverscrollBehaviorX),
|
|
||||||
mOverscrollBehaviorY(aDisplay->mOverscrollBehaviorY),
|
|
||||||
mScrollSnapTypeX(aDisplay->mScrollSnapTypeX),
|
mScrollSnapTypeX(aDisplay->mScrollSnapTypeX),
|
||||||
mScrollSnapTypeY(aDisplay->mScrollSnapTypeY),
|
mScrollSnapTypeY(aDisplay->mScrollSnapTypeY),
|
||||||
mScrollSnapPointsX(aDisplay->mScrollSnapPointsX),
|
mScrollSnapPointsX(aDisplay->mScrollSnapPointsX),
|
||||||
@@ -25,8 +23,6 @@ namespace mozilla {
|
|||||||
ScrollbarStyles::ScrollbarStyles(const nsStyleDisplay* aDisplay)
|
ScrollbarStyles::ScrollbarStyles(const nsStyleDisplay* aDisplay)
|
||||||
: mHorizontal(aDisplay->mOverflowX), mVertical(aDisplay->mOverflowY),
|
: mHorizontal(aDisplay->mOverflowX), mVertical(aDisplay->mOverflowY),
|
||||||
mScrollBehavior(aDisplay->mScrollBehavior),
|
mScrollBehavior(aDisplay->mScrollBehavior),
|
||||||
mOverscrollBehaviorX(aDisplay->mOverscrollBehaviorX),
|
|
||||||
mOverscrollBehaviorY(aDisplay->mOverscrollBehaviorY),
|
|
||||||
mScrollSnapTypeX(aDisplay->mScrollSnapTypeX),
|
mScrollSnapTypeX(aDisplay->mScrollSnapTypeX),
|
||||||
mScrollSnapTypeY(aDisplay->mScrollSnapTypeY),
|
mScrollSnapTypeY(aDisplay->mScrollSnapTypeY),
|
||||||
mScrollSnapPointsX(aDisplay->mScrollSnapPointsX),
|
mScrollSnapPointsX(aDisplay->mScrollSnapPointsX),
|
||||||
|
|||||||
@@ -26,8 +26,6 @@ struct ScrollbarStyles
|
|||||||
// Always one of NS_STYLE_SCROLL_BEHAVIOR_AUTO or
|
// Always one of NS_STYLE_SCROLL_BEHAVIOR_AUTO or
|
||||||
// NS_STYLE_SCROLL_BEHAVIOR_SMOOTH
|
// NS_STYLE_SCROLL_BEHAVIOR_SMOOTH
|
||||||
uint8_t mScrollBehavior;
|
uint8_t mScrollBehavior;
|
||||||
mozilla::StyleOverscrollBehavior mOverscrollBehaviorX;
|
|
||||||
mozilla::StyleOverscrollBehavior mOverscrollBehaviorY;
|
|
||||||
// Always one of NS_STYLE_SCROLL_SNAP_NONE, NS_STYLE_SCROLL_SNAP_MANDATORY,
|
// Always one of NS_STYLE_SCROLL_SNAP_NONE, NS_STYLE_SCROLL_SNAP_MANDATORY,
|
||||||
// or NS_STYLE_SCROLL_SNAP_PROXIMITY.
|
// or NS_STYLE_SCROLL_SNAP_PROXIMITY.
|
||||||
uint8_t mScrollSnapTypeX;
|
uint8_t mScrollSnapTypeX;
|
||||||
@@ -40,8 +38,6 @@ struct ScrollbarStyles
|
|||||||
ScrollbarStyles(uint8_t aH, uint8_t aV)
|
ScrollbarStyles(uint8_t aH, uint8_t aV)
|
||||||
: mHorizontal(aH), mVertical(aV),
|
: mHorizontal(aH), mVertical(aV),
|
||||||
mScrollBehavior(NS_STYLE_SCROLL_BEHAVIOR_AUTO),
|
mScrollBehavior(NS_STYLE_SCROLL_BEHAVIOR_AUTO),
|
||||||
mOverscrollBehaviorX(StyleOverscrollBehavior::Auto),
|
|
||||||
mOverscrollBehaviorY(StyleOverscrollBehavior::Auto),
|
|
||||||
mScrollSnapTypeX(NS_STYLE_SCROLL_SNAP_TYPE_NONE),
|
mScrollSnapTypeX(NS_STYLE_SCROLL_SNAP_TYPE_NONE),
|
||||||
mScrollSnapTypeY(NS_STYLE_SCROLL_SNAP_TYPE_NONE),
|
mScrollSnapTypeY(NS_STYLE_SCROLL_SNAP_TYPE_NONE),
|
||||||
mScrollSnapPointsX(nsStyleCoord(eStyleUnit_None)),
|
mScrollSnapPointsX(nsStyleCoord(eStyleUnit_None)),
|
||||||
@@ -60,8 +56,6 @@ struct ScrollbarStyles
|
|||||||
bool operator==(const ScrollbarStyles& aStyles) const {
|
bool operator==(const ScrollbarStyles& aStyles) const {
|
||||||
return aStyles.mHorizontal == mHorizontal && aStyles.mVertical == mVertical &&
|
return aStyles.mHorizontal == mHorizontal && aStyles.mVertical == mVertical &&
|
||||||
aStyles.mScrollBehavior == mScrollBehavior &&
|
aStyles.mScrollBehavior == mScrollBehavior &&
|
||||||
aStyles.mOverscrollBehaviorX == mOverscrollBehaviorX &&
|
|
||||||
aStyles.mOverscrollBehaviorY == mOverscrollBehaviorY &&
|
|
||||||
aStyles.mScrollSnapTypeX == mScrollSnapTypeX &&
|
aStyles.mScrollSnapTypeX == mScrollSnapTypeX &&
|
||||||
aStyles.mScrollSnapTypeY == mScrollSnapTypeY &&
|
aStyles.mScrollSnapTypeY == mScrollSnapTypeY &&
|
||||||
aStyles.mScrollSnapPointsX == mScrollSnapPointsX &&
|
aStyles.mScrollSnapPointsX == mScrollSnapPointsX &&
|
||||||
|
|||||||
@@ -9357,11 +9357,6 @@ nsLayoutUtils::ComputeScrollMetadata(nsIFrame* aForFrame,
|
|||||||
metadata.SetUsesContainerScrolling(scrollableFrame->UsesContainerScrolling());
|
metadata.SetUsesContainerScrolling(scrollableFrame->UsesContainerScrolling());
|
||||||
|
|
||||||
metadata.SetSnapInfo(scrollableFrame->GetScrollSnapInfo());
|
metadata.SetSnapInfo(scrollableFrame->GetScrollSnapInfo());
|
||||||
|
|
||||||
ScrollbarStyles scrollbarStyles = scrollableFrame->GetScrollbarStyles();
|
|
||||||
metadata.SetOverscrollBehavior(OverscrollBehaviorInfo::FromStyleConstants(
|
|
||||||
scrollbarStyles.mOverscrollBehaviorX,
|
|
||||||
scrollbarStyles.mOverscrollBehaviorY));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we have the scrollparent being the same as the scroll id, the
|
// If we have the scrollparent being the same as the scroll id, the
|
||||||
|
|||||||
@@ -1468,18 +1468,6 @@ Declaration::GetPropertyValueInternal(
|
|||||||
AppendValueToString(subprops[0], aValue);
|
AppendValueToString(subprops[0], aValue);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case eCSSProperty_overscroll_behavior: {
|
|
||||||
const nsCSSValue& xValue =
|
|
||||||
*data->ValueFor(eCSSProperty_overscroll_behavior_x);
|
|
||||||
const nsCSSValue& yValue =
|
|
||||||
*data->ValueFor(eCSSProperty_overscroll_behavior_y);
|
|
||||||
AppendValueToString(eCSSProperty_overscroll_behavior_x, aValue);
|
|
||||||
if (yValue != xValue) {
|
|
||||||
aValue.Append(char16_t(' '));
|
|
||||||
AppendValueToString(eCSSProperty_overscroll_behavior_y, aValue);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case eCSSProperty_scroll_snap_type: {
|
case eCSSProperty_scroll_snap_type: {
|
||||||
const nsCSSValue& xValue =
|
const nsCSSValue& xValue =
|
||||||
*data->ValueFor(eCSSProperty_scroll_snap_type_x);
|
*data->ValueFor(eCSSProperty_scroll_snap_type_x);
|
||||||
|
|||||||
@@ -173,7 +173,6 @@ rusty-enums = [
|
|||||||
"StyleBoxDecorationBreak",
|
"StyleBoxDecorationBreak",
|
||||||
"StyleRuleInclusion",
|
"StyleRuleInclusion",
|
||||||
"StyleGridTrackBreadth",
|
"StyleGridTrackBreadth",
|
||||||
"StyleOverscrollBehavior",
|
|
||||||
"nsStyleImageType",
|
"nsStyleImageType",
|
||||||
"StyleWhiteSpace",
|
"StyleWhiteSpace",
|
||||||
"nsStyleSVGPaintType",
|
"nsStyleSVGPaintType",
|
||||||
|
|||||||
@@ -996,7 +996,6 @@ protected:
|
|||||||
bool ParseScrollSnapPoints(nsCSSValue& aValue, nsCSSPropertyID aPropID);
|
bool ParseScrollSnapPoints(nsCSSValue& aValue, nsCSSPropertyID aPropID);
|
||||||
bool ParseScrollSnapDestination(nsCSSValue& aValue);
|
bool ParseScrollSnapDestination(nsCSSValue& aValue);
|
||||||
bool ParseScrollSnapCoordinate(nsCSSValue& aValue);
|
bool ParseScrollSnapCoordinate(nsCSSValue& aValue);
|
||||||
bool ParseOverscrollBehavior();
|
|
||||||
bool ParseWebkitTextStroke();
|
bool ParseWebkitTextStroke();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -10659,7 +10658,7 @@ CSSParserImpl::ParseWebkitGradientRadius(float& aRadius)
|
|||||||
// (either a percentage or a number between 0 and 1.0), and a color (any
|
// (either a percentage or a number between 0 and 1.0), and a color (any
|
||||||
// valid CSS color). In addition the shorthand functions from and to are
|
// valid CSS color). In addition the shorthand functions from and to are
|
||||||
// supported. These functions only require a color argument and are
|
// supported. These functions only require a color argument and are
|
||||||
// equivalent to color-stop(0, ...) and color-stop(1.0, ...) respectively.
|
// equivalent to color-stop(0, ...) and color-stop(1.0, …) respectively.
|
||||||
bool
|
bool
|
||||||
CSSParserImpl::ParseWebkitGradientColorStop(nsCSSValueGradient* aGradient)
|
CSSParserImpl::ParseWebkitGradientColorStop(nsCSSValueGradient* aGradient)
|
||||||
{
|
{
|
||||||
@@ -11812,8 +11811,6 @@ CSSParserImpl::ParsePropertyByFunction(nsCSSPropertyID aPropID)
|
|||||||
return ParseMarker();
|
return ParseMarker();
|
||||||
case eCSSProperty_paint_order:
|
case eCSSProperty_paint_order:
|
||||||
return ParsePaintOrder();
|
return ParsePaintOrder();
|
||||||
case eCSSProperty_overscroll_behavior:
|
|
||||||
return ParseOverscrollBehavior();
|
|
||||||
case eCSSProperty_scroll_snap_type:
|
case eCSSProperty_scroll_snap_type:
|
||||||
return ParseScrollSnapType();
|
return ParseScrollSnapType();
|
||||||
case eCSSProperty_mask:
|
case eCSSProperty_mask:
|
||||||
@@ -17495,31 +17492,6 @@ CSSParserImpl::ParseVariableDeclaration(CSSVariableDeclarations::Type* aType,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
|
||||||
CSSParserImpl::ParseOverscrollBehavior()
|
|
||||||
{
|
|
||||||
static const nsCSSPropertyID ids[] = {
|
|
||||||
eCSSProperty_overscroll_behavior_x,
|
|
||||||
eCSSProperty_overscroll_behavior_y
|
|
||||||
};
|
|
||||||
const int32_t numProps = MOZ_ARRAY_LENGTH(ids);
|
|
||||||
|
|
||||||
nsCSSValue values[numProps];
|
|
||||||
int32_t found = ParseChoice(values, ids, numProps);
|
|
||||||
if (found < 1) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// If only one value is specified, it's used for both axes.
|
|
||||||
if (found == 1) {
|
|
||||||
values[1] = values[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
AppendValue(eCSSProperty_overscroll_behavior_x, values[0]);
|
|
||||||
AppendValue(eCSSProperty_overscroll_behavior_y, values[1]);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
CSSParserImpl::ParseScrollSnapType()
|
CSSParserImpl::ParseScrollSnapType()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3657,32 +3657,6 @@ CSS_PROP_DISPLAY(
|
|||||||
kScrollBehaviorKTable,
|
kScrollBehaviorKTable,
|
||||||
CSS_PROP_NO_OFFSET,
|
CSS_PROP_NO_OFFSET,
|
||||||
eStyleAnimType_Discrete)
|
eStyleAnimType_Discrete)
|
||||||
CSS_PROP_SHORTHAND(
|
|
||||||
overscroll-behavior,
|
|
||||||
overscroll_behavior,
|
|
||||||
OverscrollBehavior,
|
|
||||||
CSS_PROPERTY_PARSE_FUNCTION,
|
|
||||||
"layout.css.overscroll-behavior.enabled")
|
|
||||||
CSS_PROP_DISPLAY(
|
|
||||||
overscroll-behavior-x,
|
|
||||||
overscroll_behavior_x,
|
|
||||||
OverscrollBehaviorX,
|
|
||||||
CSS_PROPERTY_PARSE_VALUE,
|
|
||||||
"layout.css.overscroll-behavior.enabled",
|
|
||||||
VARIANT_HK,
|
|
||||||
kOverscrollBehaviorKTable,
|
|
||||||
CSS_PROP_NO_OFFSET,
|
|
||||||
eStyleAnimType_Discrete)
|
|
||||||
CSS_PROP_DISPLAY(
|
|
||||||
overscroll-behavior-y,
|
|
||||||
overscroll_behavior_y,
|
|
||||||
OverscrollBehaviorY,
|
|
||||||
CSS_PROPERTY_PARSE_VALUE,
|
|
||||||
"layout.css.overscroll-behavior.enabled",
|
|
||||||
VARIANT_HK,
|
|
||||||
kOverscrollBehaviorKTable,
|
|
||||||
CSS_PROP_NO_OFFSET,
|
|
||||||
eStyleAnimType_Discrete)
|
|
||||||
CSS_PROP_DISPLAY(
|
CSS_PROP_DISPLAY(
|
||||||
scroll-snap-coordinate,
|
scroll-snap-coordinate,
|
||||||
scroll_snap_coordinate,
|
scroll_snap_coordinate,
|
||||||
|
|||||||
@@ -1939,13 +1939,6 @@ const KTableEntry nsCSSProps::kScrollBehaviorKTable[] = {
|
|||||||
{ eCSSKeyword_UNKNOWN, -1 }
|
{ eCSSKeyword_UNKNOWN, -1 }
|
||||||
};
|
};
|
||||||
|
|
||||||
const KTableEntry nsCSSProps::kOverscrollBehaviorKTable[] = {
|
|
||||||
{ eCSSKeyword_auto, StyleOverscrollBehavior::Auto },
|
|
||||||
{ eCSSKeyword_contain, StyleOverscrollBehavior::Contain },
|
|
||||||
{ eCSSKeyword_none, StyleOverscrollBehavior::None },
|
|
||||||
{ eCSSKeyword_UNKNOWN, -1 }
|
|
||||||
};
|
|
||||||
|
|
||||||
const KTableEntry nsCSSProps::kScrollSnapTypeKTable[] = {
|
const KTableEntry nsCSSProps::kScrollSnapTypeKTable[] = {
|
||||||
{ eCSSKeyword_none, NS_STYLE_SCROLL_SNAP_TYPE_NONE },
|
{ eCSSKeyword_none, NS_STYLE_SCROLL_SNAP_TYPE_NONE },
|
||||||
{ eCSSKeyword_mandatory, NS_STYLE_SCROLL_SNAP_TYPE_MANDATORY },
|
{ eCSSKeyword_mandatory, NS_STYLE_SCROLL_SNAP_TYPE_MANDATORY },
|
||||||
@@ -3010,12 +3003,6 @@ static const nsCSSPropertyID gMozTransformSubpropTable[] = {
|
|||||||
eCSSProperty_UNKNOWN
|
eCSSProperty_UNKNOWN
|
||||||
};
|
};
|
||||||
|
|
||||||
static const nsCSSPropertyID gOverscrollBehaviorSubpropTable[] = {
|
|
||||||
eCSSProperty_overscroll_behavior_x,
|
|
||||||
eCSSProperty_overscroll_behavior_y,
|
|
||||||
eCSSProperty_UNKNOWN
|
|
||||||
};
|
|
||||||
|
|
||||||
static const nsCSSPropertyID gScrollSnapTypeSubpropTable[] = {
|
static const nsCSSPropertyID gScrollSnapTypeSubpropTable[] = {
|
||||||
eCSSProperty_scroll_snap_type_x,
|
eCSSProperty_scroll_snap_type_x,
|
||||||
eCSSProperty_scroll_snap_type_y,
|
eCSSProperty_scroll_snap_type_y,
|
||||||
|
|||||||
@@ -837,7 +837,6 @@ public:
|
|||||||
static const KTableEntry kRubyAlignKTable[];
|
static const KTableEntry kRubyAlignKTable[];
|
||||||
static const KTableEntry kRubyPositionKTable[];
|
static const KTableEntry kRubyPositionKTable[];
|
||||||
static const KTableEntry kScrollBehaviorKTable[];
|
static const KTableEntry kScrollBehaviorKTable[];
|
||||||
static const KTableEntry kOverscrollBehaviorKTable[];
|
|
||||||
static const KTableEntry kScrollSnapTypeKTable[];
|
static const KTableEntry kScrollSnapTypeKTable[];
|
||||||
static const KTableEntry kSpeakKTable[];
|
static const KTableEntry kSpeakKTable[];
|
||||||
static const KTableEntry kSpeakHeaderKTable[];
|
static const KTableEntry kSpeakHeaderKTable[];
|
||||||
|
|||||||
@@ -3622,26 +3622,6 @@ nsComputedDOMStyle::DoGetScrollBehavior()
|
|||||||
return val.forget();
|
return val.forget();
|
||||||
}
|
}
|
||||||
|
|
||||||
already_AddRefed<CSSValue>
|
|
||||||
nsComputedDOMStyle::DoGetOverscrollBehaviorX()
|
|
||||||
{
|
|
||||||
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
|
||||||
val->SetIdent(
|
|
||||||
nsCSSProps::ValueToKeywordEnum(StyleDisplay()->mOverscrollBehaviorX,
|
|
||||||
nsCSSProps::kOverscrollBehaviorKTable));
|
|
||||||
return val.forget();
|
|
||||||
}
|
|
||||||
|
|
||||||
already_AddRefed<CSSValue>
|
|
||||||
nsComputedDOMStyle::DoGetOverscrollBehaviorY()
|
|
||||||
{
|
|
||||||
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
|
||||||
val->SetIdent(
|
|
||||||
nsCSSProps::ValueToKeywordEnum(StyleDisplay()->mOverscrollBehaviorY,
|
|
||||||
nsCSSProps::kOverscrollBehaviorKTable));
|
|
||||||
return val.forget();
|
|
||||||
}
|
|
||||||
|
|
||||||
already_AddRefed<CSSValue>
|
already_AddRefed<CSSValue>
|
||||||
nsComputedDOMStyle::DoGetScrollSnapType()
|
nsComputedDOMStyle::DoGetScrollSnapType()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -516,8 +516,6 @@ private:
|
|||||||
already_AddRefed<CSSValue> DoGetTransformStyle();
|
already_AddRefed<CSSValue> DoGetTransformStyle();
|
||||||
already_AddRefed<CSSValue> DoGetOrient();
|
already_AddRefed<CSSValue> DoGetOrient();
|
||||||
already_AddRefed<CSSValue> DoGetScrollBehavior();
|
already_AddRefed<CSSValue> DoGetScrollBehavior();
|
||||||
already_AddRefed<CSSValue> DoGetOverscrollBehaviorX();
|
|
||||||
already_AddRefed<CSSValue> DoGetOverscrollBehaviorY();
|
|
||||||
already_AddRefed<CSSValue> DoGetScrollSnapType();
|
already_AddRefed<CSSValue> DoGetScrollSnapType();
|
||||||
already_AddRefed<CSSValue> DoGetScrollSnapTypeX();
|
already_AddRefed<CSSValue> DoGetScrollSnapTypeX();
|
||||||
already_AddRefed<CSSValue> DoGetScrollSnapTypeY();
|
already_AddRefed<CSSValue> DoGetScrollSnapTypeY();
|
||||||
|
|||||||
@@ -203,8 +203,6 @@ COMPUTED_STYLE_PROP(overflow_clip_box, OverflowClipBox)
|
|||||||
COMPUTED_STYLE_PROP(overflow_wrap, OverflowWrap)
|
COMPUTED_STYLE_PROP(overflow_wrap, OverflowWrap)
|
||||||
COMPUTED_STYLE_PROP(overflow_x, OverflowX)
|
COMPUTED_STYLE_PROP(overflow_x, OverflowX)
|
||||||
COMPUTED_STYLE_PROP(overflow_y, OverflowY)
|
COMPUTED_STYLE_PROP(overflow_y, OverflowY)
|
||||||
COMPUTED_STYLE_PROP(overscroll_behavior_x, OverscrollBehaviorX)
|
|
||||||
COMPUTED_STYLE_PROP(overscroll_behavior_y, OverscrollBehaviorY)
|
|
||||||
//// COMPUTED_STYLE_PROP(padding, Padding)
|
//// COMPUTED_STYLE_PROP(padding, Padding)
|
||||||
COMPUTED_STYLE_PROP(padding_bottom, PaddingBottom)
|
COMPUTED_STYLE_PROP(padding_bottom, PaddingBottom)
|
||||||
COMPUTED_STYLE_PROP(padding_left, PaddingLeft)
|
COMPUTED_STYLE_PROP(padding_left, PaddingLeft)
|
||||||
|
|||||||
@@ -1437,7 +1437,6 @@ struct SetEnumValueHelper
|
|||||||
DEFINE_ENUM_CLASS_SETTER(StyleFloat, None, InlineEnd)
|
DEFINE_ENUM_CLASS_SETTER(StyleFloat, None, InlineEnd)
|
||||||
DEFINE_ENUM_CLASS_SETTER(StyleFloatEdge, ContentBox, MarginBox)
|
DEFINE_ENUM_CLASS_SETTER(StyleFloatEdge, ContentBox, MarginBox)
|
||||||
DEFINE_ENUM_CLASS_SETTER(StyleHyphens, None, Auto)
|
DEFINE_ENUM_CLASS_SETTER(StyleHyphens, None, Auto)
|
||||||
DEFINE_ENUM_CLASS_SETTER(StyleOverscrollBehavior, Auto, None)
|
|
||||||
DEFINE_ENUM_CLASS_SETTER(StyleStackSizing, Ignore, IgnoreVertical)
|
DEFINE_ENUM_CLASS_SETTER(StyleStackSizing, Ignore, IgnoreVertical)
|
||||||
DEFINE_ENUM_CLASS_SETTER(StyleTextJustify, None, InterCharacter)
|
DEFINE_ENUM_CLASS_SETTER(StyleTextJustify, None, InterCharacter)
|
||||||
DEFINE_ENUM_CLASS_SETTER(StyleUserFocus, None, SelectMenu)
|
DEFINE_ENUM_CLASS_SETTER(StyleUserFocus, None, SelectMenu)
|
||||||
@@ -5812,22 +5811,6 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct,
|
|||||||
SETVAL_ENUMERATED | SETVAL_UNSET_INITIAL,
|
SETVAL_ENUMERATED | SETVAL_UNSET_INITIAL,
|
||||||
parentDisplay->mScrollBehavior, NS_STYLE_SCROLL_BEHAVIOR_AUTO);
|
parentDisplay->mScrollBehavior, NS_STYLE_SCROLL_BEHAVIOR_AUTO);
|
||||||
|
|
||||||
// overscroll-behavior-x: none, enum, inherit, initial
|
|
||||||
SetValue(*aRuleData->ValueForOverscrollBehaviorX(),
|
|
||||||
display->mOverscrollBehaviorX,
|
|
||||||
conditions,
|
|
||||||
SETVAL_ENUMERATED | SETVAL_UNSET_INITIAL,
|
|
||||||
parentDisplay->mOverscrollBehaviorX,
|
|
||||||
StyleOverscrollBehavior::Auto);
|
|
||||||
|
|
||||||
// overscroll-behavior-y: none, enum, inherit, initial
|
|
||||||
SetValue(*aRuleData->ValueForOverscrollBehaviorY(),
|
|
||||||
display->mOverscrollBehaviorY,
|
|
||||||
conditions,
|
|
||||||
SETVAL_ENUMERATED | SETVAL_UNSET_INITIAL,
|
|
||||||
parentDisplay->mOverscrollBehaviorY,
|
|
||||||
StyleOverscrollBehavior::Auto);
|
|
||||||
|
|
||||||
// scroll-snap-type-x: none, enum, inherit, initial
|
// scroll-snap-type-x: none, enum, inherit, initial
|
||||||
SetValue(*aRuleData->ValueForScrollSnapTypeX(), display->mScrollSnapTypeX,
|
SetValue(*aRuleData->ValueForScrollSnapTypeX(), display->mScrollSnapTypeX,
|
||||||
conditions,
|
conditions,
|
||||||
|
|||||||
@@ -1188,13 +1188,6 @@ enum class StyleWhiteSpace : uint8_t {
|
|||||||
#define NS_STYLE_SCROLL_BEHAVIOR_AUTO 0
|
#define NS_STYLE_SCROLL_BEHAVIOR_AUTO 0
|
||||||
#define NS_STYLE_SCROLL_BEHAVIOR_SMOOTH 1
|
#define NS_STYLE_SCROLL_BEHAVIOR_SMOOTH 1
|
||||||
|
|
||||||
// See nsStyleDisplay::mOverscrollBehavior{X,Y}
|
|
||||||
enum class StyleOverscrollBehavior : uint8_t {
|
|
||||||
Auto = 0,
|
|
||||||
Contain,
|
|
||||||
None,
|
|
||||||
};
|
|
||||||
|
|
||||||
// See nsStyleDisplay::mScrollSnapType{X,Y}
|
// See nsStyleDisplay::mScrollSnapType{X,Y}
|
||||||
#define NS_STYLE_SCROLL_SNAP_TYPE_NONE 0
|
#define NS_STYLE_SCROLL_SNAP_TYPE_NONE 0
|
||||||
#define NS_STYLE_SCROLL_SNAP_TYPE_MANDATORY 1
|
#define NS_STYLE_SCROLL_SNAP_TYPE_MANDATORY 1
|
||||||
|
|||||||
@@ -3568,8 +3568,6 @@ nsStyleDisplay::nsStyleDisplay(const nsPresContext* aContext)
|
|||||||
, mWillChangeBitField(0)
|
, mWillChangeBitField(0)
|
||||||
, mTouchAction(NS_STYLE_TOUCH_ACTION_AUTO)
|
, mTouchAction(NS_STYLE_TOUCH_ACTION_AUTO)
|
||||||
, mScrollBehavior(NS_STYLE_SCROLL_BEHAVIOR_AUTO)
|
, mScrollBehavior(NS_STYLE_SCROLL_BEHAVIOR_AUTO)
|
||||||
, mOverscrollBehaviorX(StyleOverscrollBehavior::Auto)
|
|
||||||
, mOverscrollBehaviorY(StyleOverscrollBehavior::Auto)
|
|
||||||
, mScrollSnapTypeX(NS_STYLE_SCROLL_SNAP_TYPE_NONE)
|
, mScrollSnapTypeX(NS_STYLE_SCROLL_SNAP_TYPE_NONE)
|
||||||
, mScrollSnapTypeY(NS_STYLE_SCROLL_SNAP_TYPE_NONE)
|
, mScrollSnapTypeY(NS_STYLE_SCROLL_SNAP_TYPE_NONE)
|
||||||
, mScrollSnapPointsX(eStyleUnit_None)
|
, mScrollSnapPointsX(eStyleUnit_None)
|
||||||
@@ -3633,8 +3631,6 @@ nsStyleDisplay::nsStyleDisplay(const nsStyleDisplay& aSource)
|
|||||||
, mWillChange(aSource.mWillChange)
|
, mWillChange(aSource.mWillChange)
|
||||||
, mTouchAction(aSource.mTouchAction)
|
, mTouchAction(aSource.mTouchAction)
|
||||||
, mScrollBehavior(aSource.mScrollBehavior)
|
, mScrollBehavior(aSource.mScrollBehavior)
|
||||||
, mOverscrollBehaviorX(aSource.mOverscrollBehaviorX)
|
|
||||||
, mOverscrollBehaviorY(aSource.mOverscrollBehaviorY)
|
|
||||||
, mScrollSnapTypeX(aSource.mScrollSnapTypeX)
|
, mScrollSnapTypeX(aSource.mScrollSnapTypeX)
|
||||||
, mScrollSnapTypeY(aSource.mScrollSnapTypeY)
|
, mScrollSnapTypeY(aSource.mScrollSnapTypeY)
|
||||||
, mScrollSnapPointsX(aSource.mScrollSnapPointsX)
|
, mScrollSnapPointsX(aSource.mScrollSnapPointsX)
|
||||||
@@ -3899,13 +3895,6 @@ nsStyleDisplay::CalcDifference(const nsStyleDisplay& aNewData) const
|
|||||||
hint |= nsChangeHint_RepaintFrame;
|
hint |= nsChangeHint_RepaintFrame;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If overscroll-behavior has changed, the changes are picked up
|
|
||||||
// during a repaint.
|
|
||||||
if (mOverscrollBehaviorX != aNewData.mOverscrollBehaviorX ||
|
|
||||||
mOverscrollBehaviorY != aNewData.mOverscrollBehaviorY) {
|
|
||||||
hint |= nsChangeHint_SchedulePaint;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Note: Our current behavior for handling changes to the
|
// Note: Our current behavior for handling changes to the
|
||||||
// transition-duration, transition-delay, and transition-timing-function
|
// transition-duration, transition-delay, and transition-timing-function
|
||||||
// properties is to do nothing. In other words, the transition
|
// properties is to do nothing. In other words, the transition
|
||||||
|
|||||||
@@ -2587,8 +2587,6 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleDisplay
|
|||||||
|
|
||||||
uint8_t mTouchAction; // [reset] see nsStyleConsts.h
|
uint8_t mTouchAction; // [reset] see nsStyleConsts.h
|
||||||
uint8_t mScrollBehavior; // [reset] see nsStyleConsts.h NS_STYLE_SCROLL_BEHAVIOR_*
|
uint8_t mScrollBehavior; // [reset] see nsStyleConsts.h NS_STYLE_SCROLL_BEHAVIOR_*
|
||||||
mozilla::StyleOverscrollBehavior mOverscrollBehaviorX; // [reset] see nsStyleConsts.h
|
|
||||||
mozilla::StyleOverscrollBehavior mOverscrollBehaviorY; // [reset] see nsStyleConsts.h
|
|
||||||
uint8_t mScrollSnapTypeX; // [reset] see nsStyleConsts.h NS_STYLE_SCROLL_SNAP_TYPE_*
|
uint8_t mScrollSnapTypeX; // [reset] see nsStyleConsts.h NS_STYLE_SCROLL_SNAP_TYPE_*
|
||||||
uint8_t mScrollSnapTypeY; // [reset] see nsStyleConsts.h NS_STYLE_SCROLL_SNAP_TYPE_*
|
uint8_t mScrollSnapTypeY; // [reset] see nsStyleConsts.h NS_STYLE_SCROLL_SNAP_TYPE_*
|
||||||
nsStyleCoord mScrollSnapPointsX; // [reset]
|
nsStyleCoord mScrollSnapPointsX; // [reset]
|
||||||
|
|||||||
@@ -255,7 +255,6 @@ skip-if = android_version == '18' #debug-only failure; timed out #Android 4.3 aw
|
|||||||
[test_namespace_rule.html]
|
[test_namespace_rule.html]
|
||||||
[test_non_content_accessible_properties.html]
|
[test_non_content_accessible_properties.html]
|
||||||
[test_of_type_selectors.xhtml]
|
[test_of_type_selectors.xhtml]
|
||||||
[test_overscroll_behavior_pref.html]
|
|
||||||
[test_page_parser.html]
|
[test_page_parser.html]
|
||||||
[test_parse_eof.html]
|
[test_parse_eof.html]
|
||||||
[test_parse_ident.html]
|
[test_parse_ident.html]
|
||||||
|
|||||||
@@ -7452,34 +7452,6 @@ if (IsCSSPropertyPrefEnabled("layout.css.scroll-behavior.property-enabled")) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsCSSPropertyPrefEnabled("layout.css.overscroll-behavior.enabled")) {
|
|
||||||
gCSSProperties["overscroll-behavior-x"] = {
|
|
||||||
domProp: "overscrollBehaviorX",
|
|
||||||
inherited: false,
|
|
||||||
type: CSS_TYPE_LONGHAND,
|
|
||||||
initial_values: [ "auto" ],
|
|
||||||
other_values: [ "contain", "none" ],
|
|
||||||
invalid_values: [ "left", "1px" ]
|
|
||||||
};
|
|
||||||
gCSSProperties["overscroll-behavior-y"] = {
|
|
||||||
domProp: "overscrollBehaviorY",
|
|
||||||
inherited: false,
|
|
||||||
type: CSS_TYPE_LONGHAND,
|
|
||||||
initial_values: [ "auto" ],
|
|
||||||
other_values: [ "contain", "none" ],
|
|
||||||
invalid_values: [ "left", "1px" ]
|
|
||||||
};
|
|
||||||
gCSSProperties["overscroll-behavior"] = {
|
|
||||||
domProp: "overscrollBehavior",
|
|
||||||
inherited: false,
|
|
||||||
type: CSS_TYPE_TRUE_SHORTHAND,
|
|
||||||
subproperties: [ "overscroll-behavior-x", "overscroll-behavior-y" ],
|
|
||||||
initial_values: [ "auto" ],
|
|
||||||
other_values: [ "contain", "none", "contain contain", "contain auto", "none contain" ],
|
|
||||||
invalid_values: [ "left", "1px", "contain auto none", "contain nonsense" ]
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
if (IsCSSPropertyPrefEnabled("layout.css.scroll-snap.enabled")) {
|
if (IsCSSPropertyPrefEnabled("layout.css.scroll-snap.enabled")) {
|
||||||
gCSSProperties["scroll-snap-coordinate"] = {
|
gCSSProperties["scroll-snap-coordinate"] = {
|
||||||
domProp: "scrollSnapCoordinate",
|
domProp: "scrollSnapCoordinate",
|
||||||
|
|||||||
@@ -1,24 +0,0 @@
|
|||||||
<!doctype html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
|
||||||
<title>Test pref for overscroll-behavior property</title>
|
|
||||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
||||||
</head>
|
|
||||||
<script class="testbody" type="text/javascript">
|
|
||||||
function runTest() {
|
|
||||||
let css = "div { overscroll-behavior: auto; }";
|
|
||||||
let style = document.createElement('style');
|
|
||||||
style.appendChild(document.createTextNode(css));
|
|
||||||
document.head.appendChild(style);
|
|
||||||
|
|
||||||
is(document.styleSheets[0].cssRules[0].style.length,
|
|
||||||
0,
|
|
||||||
"overscroll-behavior shouldn't be parsed if the pref is off");
|
|
||||||
SimpleTest.finish();
|
|
||||||
}
|
|
||||||
SpecialPowers.pushPrefEnv({ set: [["layout.css.overscroll-behavior.enabled", false]] },
|
|
||||||
runTest);
|
|
||||||
SimpleTest.waitForExplicitFinish();
|
|
||||||
</script>
|
|
||||||
</html>
|
|
||||||
@@ -3031,13 +3031,6 @@ pref("layout.css.column-span.enabled", false);
|
|||||||
// Are inter-character ruby annotations enabled?
|
// Are inter-character ruby annotations enabled?
|
||||||
pref("layout.css.ruby.intercharacter.enabled", false);
|
pref("layout.css.ruby.intercharacter.enabled", false);
|
||||||
|
|
||||||
// Is support for overscroll-behavior enabled?
|
|
||||||
#ifdef RELEASE_OR_BETA
|
|
||||||
pref("layout.css.overscroll-behavior.enabled", false);
|
|
||||||
#else
|
|
||||||
pref("layout.css.overscroll-behavior.enabled", true);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// pref for which side vertical scrollbars should be on
|
// pref for which side vertical scrollbars should be on
|
||||||
// 0 = end-side in UI direction
|
// 0 = end-side in UI direction
|
||||||
// 1 = end-side in document/content direction
|
// 1 = end-side in document/content direction
|
||||||
|
|||||||
@@ -52,7 +52,6 @@
|
|||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
setup({explicit_timeout: true});
|
|
||||||
const container = document.getElementById('container');
|
const container = document.getElementById('container');
|
||||||
const non_scrollable = document.getElementById('non_scrollable');
|
const non_scrollable = document.getElementById('non_scrollable');
|
||||||
const root = document.getElementById('root');
|
const root = document.getElementById('root');
|
||||||
|
|||||||
@@ -490,7 +490,6 @@ PanGestureInput::PanGestureInput()
|
|||||||
, mHandledByAPZ(false)
|
, mHandledByAPZ(false)
|
||||||
, mFollowedByMomentum(false)
|
, mFollowedByMomentum(false)
|
||||||
, mRequiresContentResponseIfCannotScrollHorizontallyInStartDirection(false)
|
, mRequiresContentResponseIfCannotScrollHorizontallyInStartDirection(false)
|
||||||
, mOverscrollBehaviorAllowsSwipe(false)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -510,7 +509,6 @@ PanGestureInput::PanGestureInput(PanGestureType aType, uint32_t aTime,
|
|||||||
, mHandledByAPZ(false)
|
, mHandledByAPZ(false)
|
||||||
, mFollowedByMomentum(false)
|
, mFollowedByMomentum(false)
|
||||||
, mRequiresContentResponseIfCannotScrollHorizontallyInStartDirection(false)
|
, mRequiresContentResponseIfCannotScrollHorizontallyInStartDirection(false)
|
||||||
, mOverscrollBehaviorAllowsSwipe(false)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -385,14 +385,6 @@ public:
|
|||||||
// confirmed target.
|
// confirmed target.
|
||||||
// This is used by events that can result in a swipe instead of a scroll.
|
// This is used by events that can result in a swipe instead of a scroll.
|
||||||
bool mRequiresContentResponseIfCannotScrollHorizontallyInStartDirection;
|
bool mRequiresContentResponseIfCannotScrollHorizontallyInStartDirection;
|
||||||
|
|
||||||
// This is used by APZ to communicate to the macOS widget code whether
|
|
||||||
// the overscroll-behavior of the scroll frame handling this swipe allows
|
|
||||||
// non-local overscroll behaviors in the horizontal direction (such as
|
|
||||||
// swipe navigation).
|
|
||||||
bool mOverscrollBehaviorAllowsSwipe;
|
|
||||||
|
|
||||||
// XXX: If adding any more bools, switch to using bitfields instead.
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -2923,7 +2923,7 @@ nsChildView::DispatchAPZWheelInputEvent(InputData& aEvent, bool aCanTriggerSwipe
|
|||||||
PanGestureInput& panInput = aEvent.AsPanGestureInput();
|
PanGestureInput& panInput = aEvent.AsPanGestureInput();
|
||||||
|
|
||||||
event = panInput.ToWidgetWheelEvent(this);
|
event = panInput.ToWidgetWheelEvent(this);
|
||||||
if (aCanTriggerSwipe && panInput.mOverscrollBehaviorAllowsSwipe) {
|
if (aCanTriggerSwipe) {
|
||||||
SwipeInfo swipeInfo = SendMayStartSwipe(panInput);
|
SwipeInfo swipeInfo = SendMayStartSwipe(panInput);
|
||||||
event.mCanTriggerSwipe = swipeInfo.wantsSwipe;
|
event.mCanTriggerSwipe = swipeInfo.wantsSwipe;
|
||||||
if (swipeInfo.wantsSwipe) {
|
if (swipeInfo.wantsSwipe) {
|
||||||
|
|||||||
@@ -1225,7 +1225,6 @@ struct ParamTraits<mozilla::PanGestureInput>
|
|||||||
WriteParam(aMsg, aParam.mHandledByAPZ);
|
WriteParam(aMsg, aParam.mHandledByAPZ);
|
||||||
WriteParam(aMsg, aParam.mFollowedByMomentum);
|
WriteParam(aMsg, aParam.mFollowedByMomentum);
|
||||||
WriteParam(aMsg, aParam.mRequiresContentResponseIfCannotScrollHorizontallyInStartDirection);
|
WriteParam(aMsg, aParam.mRequiresContentResponseIfCannotScrollHorizontallyInStartDirection);
|
||||||
WriteParam(aMsg, aParam.mOverscrollBehaviorAllowsSwipe);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
|
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
|
||||||
@@ -1242,8 +1241,7 @@ struct ParamTraits<mozilla::PanGestureInput>
|
|||||||
ReadParam(aMsg, aIter, &aResult->mUserDeltaMultiplierY) &&
|
ReadParam(aMsg, aIter, &aResult->mUserDeltaMultiplierY) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mHandledByAPZ) &&
|
ReadParam(aMsg, aIter, &aResult->mHandledByAPZ) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mFollowedByMomentum) &&
|
ReadParam(aMsg, aIter, &aResult->mFollowedByMomentum) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mRequiresContentResponseIfCannotScrollHorizontallyInStartDirection) &&
|
ReadParam(aMsg, aIter, &aResult->mRequiresContentResponseIfCannotScrollHorizontallyInStartDirection);
|
||||||
ReadParam(aMsg, aIter, &aResult->mOverscrollBehaviorAllowsSwipe);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user