summaryrefslogtreecommitdiffstats
path: root/layout/base
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-03-26 18:41:32 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-03-26 18:41:32 +0100
commit1e1525c44c23bde16102a64e685e02a9ab6825cc (patch)
treea2462a2f6278466e93ddedbf71983c325698933a /layout/base
parente25ad543952b5afc13181aaebef9c5951fc27be0 (diff)
parenteb77e289bbe056b58051db0fa868e95da803aa0a (diff)
downloadUXP-1e1525c44c23bde16102a64e685e02a9ab6825cc.tar
UXP-1e1525c44c23bde16102a64e685e02a9ab6825cc.tar.gz
UXP-1e1525c44c23bde16102a64e685e02a9ab6825cc.tar.lz
UXP-1e1525c44c23bde16102a64e685e02a9ab6825cc.tar.xz
UXP-1e1525c44c23bde16102a64e685e02a9ab6825cc.zip
Merge commit 'eb77e289bbe056b58051db0fa868e95da803aa0a' into Basilisk-release
Diffstat (limited to 'layout/base')
-rw-r--r--layout/base/nsLayoutUtils.h9
-rw-r--r--layout/base/nsPresShell.cpp10
2 files changed, 10 insertions, 9 deletions
diff --git a/layout/base/nsLayoutUtils.h b/layout/base/nsLayoutUtils.h
index 63253fd10..0a82dbf6a 100644
--- a/layout/base/nsLayoutUtils.h
+++ b/layout/base/nsLayoutUtils.h
@@ -1439,13 +1439,14 @@ public:
/**
* This function increases an initial intrinsic size, 'aCurrent', according
* to the given 'aPercent', such that the size-increase makes up exactly
- * 'aPercent' percent of the returned value. If 'aPercent' is less than
- * or equal to zero the original 'aCurrent' value is returned. If 'aPercent'
- * is greater than or equal to 1.0 the value nscoord_MAX is returned.
+ * 'aPercent' percent of the returned value. If 'aPercent' or 'aCurrent' are
+ * less than or equal to zero the original 'aCurrent' value is returned.
+ * If 'aPercent' is greater than or equal to 1.0 the value nscoord_MAX is
+ * returned.
*/
static nscoord AddPercents(nscoord aCurrent, float aPercent)
{
- if (aPercent > 0.0f) {
+ if (aPercent > 0.0f && aCurrent > 0) {
return MOZ_UNLIKELY(aPercent >= 1.0f) ? nscoord_MAX
: NSToCoordRound(float(aCurrent) / (1.0f - aPercent));
}
diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp
index 969ebc962..5dfbb8dba 100644
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -7296,11 +7296,11 @@ PresShell::HandleEvent(nsIFrame* aFrame,
return NS_OK;
}
- nsIContent* capturingContent = ((aEvent->mClass == ePointerEventClass ||
- aEvent->mClass == eWheelEventClass ||
- aEvent->HasMouseEventMessage())
- ? GetCapturingContent()
- : nullptr);
+ nsCOMPtr<nsIContent> capturingContent = ((aEvent->mClass == ePointerEventClass ||
+ aEvent->mClass == eWheelEventClass ||
+ aEvent->HasMouseEventMessage())
+ ? GetCapturingContent()
+ : nullptr);
nsCOMPtr<nsIDocument> retargetEventDoc;
if (!aDontRetargetEvents) {