зеркало из https://github.com/mozilla/gecko-dev.git
Merge mozilla-central to mozilla-inbound
This commit is contained in:
Коммит
27b852f164
|
@ -21,10 +21,7 @@ StyleInfo::StyleInfo(dom::Element* aElement) : mElement(aElement) {
|
|||
|
||||
void StyleInfo::Display(nsAString& aValue) {
|
||||
aValue.Truncate();
|
||||
AppendASCIItoUTF16(
|
||||
nsCSSProps::ValueToKeyword(mComputedStyle->StyleDisplay()->mDisplay,
|
||||
nsCSSProps::kDisplayKTable),
|
||||
aValue);
|
||||
Servo_GetPropertyValue(mComputedStyle, eCSSProperty_display, &aValue);
|
||||
}
|
||||
|
||||
void StyleInfo::TextAlign(nsAString& aValue) {
|
||||
|
|
|
@ -90,9 +90,8 @@ var Fingerprinting = {
|
|||
|
||||
isAllowing(state) {
|
||||
return (
|
||||
this.enabled &&
|
||||
(state & Ci.nsIWebProgressListener.STATE_LOADED_FINGERPRINTING_CONTENT) !=
|
||||
0
|
||||
0
|
||||
);
|
||||
},
|
||||
|
||||
|
@ -222,7 +221,6 @@ var Cryptomining = {
|
|||
|
||||
isAllowing(state) {
|
||||
return (
|
||||
this.enabled &&
|
||||
(state & Ci.nsIWebProgressListener.STATE_LOADED_CRYPTOMINING_CONTENT) != 0
|
||||
);
|
||||
},
|
||||
|
|
|
@ -173,6 +173,77 @@ async function testSubview(hasException) {
|
|||
BrowserTestUtils.removeTab(tab);
|
||||
}
|
||||
|
||||
async function testCategoryItem() {
|
||||
Services.prefs.setBoolPref(CM_PROTECTION_PREF, false);
|
||||
let promise = BrowserTestUtils.openNewForegroundTab({
|
||||
url: TRACKING_PAGE,
|
||||
gBrowser,
|
||||
});
|
||||
let [tab] = await Promise.all([promise, waitForContentBlockingEvent()]);
|
||||
|
||||
let categoryItem = document.getElementById(
|
||||
"protections-popup-category-cryptominers"
|
||||
);
|
||||
|
||||
ok(
|
||||
!categoryItem.classList.contains("blocked"),
|
||||
"Category not marked as blocked"
|
||||
);
|
||||
ok(
|
||||
categoryItem.classList.contains("notFound"),
|
||||
"Category marked as not found"
|
||||
);
|
||||
Services.prefs.setBoolPref(CM_PROTECTION_PREF, true);
|
||||
ok(categoryItem.classList.contains("blocked"), "Category marked as blocked");
|
||||
ok(
|
||||
categoryItem.classList.contains("notFound"),
|
||||
"Category marked as not found"
|
||||
);
|
||||
Services.prefs.setBoolPref(CM_PROTECTION_PREF, false);
|
||||
ok(
|
||||
!categoryItem.classList.contains("blocked"),
|
||||
"Category not marked as blocked"
|
||||
);
|
||||
ok(
|
||||
categoryItem.classList.contains("notFound"),
|
||||
"Category marked as not found"
|
||||
);
|
||||
|
||||
promise = waitForContentBlockingEvent();
|
||||
|
||||
await ContentTask.spawn(tab.linkedBrowser, {}, function() {
|
||||
content.postMessage("cryptomining", "*");
|
||||
});
|
||||
|
||||
await promise;
|
||||
|
||||
ok(
|
||||
!categoryItem.classList.contains("blocked"),
|
||||
"Category not marked as blocked"
|
||||
);
|
||||
ok(
|
||||
!categoryItem.classList.contains("notFound"),
|
||||
"Category not marked as not found"
|
||||
);
|
||||
Services.prefs.setBoolPref(CM_PROTECTION_PREF, true);
|
||||
ok(categoryItem.classList.contains("blocked"), "Category marked as blocked");
|
||||
ok(
|
||||
!categoryItem.classList.contains("notFound"),
|
||||
"Category not marked as not found"
|
||||
);
|
||||
Services.prefs.setBoolPref(CM_PROTECTION_PREF, false);
|
||||
ok(
|
||||
!categoryItem.classList.contains("blocked"),
|
||||
"Category not marked as blocked"
|
||||
);
|
||||
ok(
|
||||
!categoryItem.classList.contains("notFound"),
|
||||
"Category not marked as not found"
|
||||
);
|
||||
|
||||
BrowserTestUtils.removeTab(tab);
|
||||
}
|
||||
|
||||
function testTelemetry(pagesVisited, pagesWithBlockableContent, hasException) {
|
||||
let results = cmHistogram.snapshot();
|
||||
Assert.equal(
|
||||
|
@ -197,5 +268,7 @@ add_task(async function test() {
|
|||
await testSubview(false);
|
||||
await testSubview(true);
|
||||
|
||||
await testCategoryItem();
|
||||
|
||||
Services.prefs.clearUserPref(CM_PROTECTION_PREF);
|
||||
});
|
||||
|
|
|
@ -99,6 +99,77 @@ async function testIdentityState(hasException) {
|
|||
BrowserTestUtils.removeTab(tab);
|
||||
}
|
||||
|
||||
async function testCategoryItem() {
|
||||
Services.prefs.setBoolPref(FP_PROTECTION_PREF, false);
|
||||
let promise = BrowserTestUtils.openNewForegroundTab({
|
||||
url: TRACKING_PAGE,
|
||||
gBrowser,
|
||||
});
|
||||
let [tab] = await Promise.all([promise, waitForContentBlockingEvent()]);
|
||||
|
||||
let categoryItem = document.getElementById(
|
||||
"protections-popup-category-fingerprinters"
|
||||
);
|
||||
|
||||
ok(
|
||||
!categoryItem.classList.contains("blocked"),
|
||||
"Category not marked as blocked"
|
||||
);
|
||||
ok(
|
||||
categoryItem.classList.contains("notFound"),
|
||||
"Category marked as not found"
|
||||
);
|
||||
Services.prefs.setBoolPref(FP_PROTECTION_PREF, true);
|
||||
ok(categoryItem.classList.contains("blocked"), "Category marked as blocked");
|
||||
ok(
|
||||
categoryItem.classList.contains("notFound"),
|
||||
"Category marked as not found"
|
||||
);
|
||||
Services.prefs.setBoolPref(FP_PROTECTION_PREF, false);
|
||||
ok(
|
||||
!categoryItem.classList.contains("blocked"),
|
||||
"Category not marked as blocked"
|
||||
);
|
||||
ok(
|
||||
categoryItem.classList.contains("notFound"),
|
||||
"Category marked as not found"
|
||||
);
|
||||
|
||||
promise = waitForContentBlockingEvent();
|
||||
|
||||
await ContentTask.spawn(tab.linkedBrowser, {}, function() {
|
||||
content.postMessage("fingerprinting", "*");
|
||||
});
|
||||
|
||||
await promise;
|
||||
|
||||
ok(
|
||||
!categoryItem.classList.contains("blocked"),
|
||||
"Category not marked as blocked"
|
||||
);
|
||||
ok(
|
||||
!categoryItem.classList.contains("notFound"),
|
||||
"Category not marked as not found"
|
||||
);
|
||||
Services.prefs.setBoolPref(FP_PROTECTION_PREF, true);
|
||||
ok(categoryItem.classList.contains("blocked"), "Category marked as blocked");
|
||||
ok(
|
||||
!categoryItem.classList.contains("notFound"),
|
||||
"Category not marked as not found"
|
||||
);
|
||||
Services.prefs.setBoolPref(FP_PROTECTION_PREF, false);
|
||||
ok(
|
||||
!categoryItem.classList.contains("blocked"),
|
||||
"Category not marked as blocked"
|
||||
);
|
||||
ok(
|
||||
!categoryItem.classList.contains("notFound"),
|
||||
"Category not marked as not found"
|
||||
);
|
||||
|
||||
BrowserTestUtils.removeTab(tab);
|
||||
}
|
||||
|
||||
async function testSubview(hasException) {
|
||||
fpHistogram.clear();
|
||||
let promise = BrowserTestUtils.openNewForegroundTab({
|
||||
|
@ -197,5 +268,7 @@ add_task(async function test() {
|
|||
await testSubview(false);
|
||||
await testSubview(true);
|
||||
|
||||
await testCategoryItem();
|
||||
|
||||
Services.prefs.clearUserPref(FP_PROTECTION_PREF);
|
||||
});
|
||||
|
|
|
@ -3719,11 +3719,11 @@ EditActionResult HTMLEditRules::MoveBlock(Element& aLeftBlock,
|
|||
int32_t aRightOffset) {
|
||||
MOZ_ASSERT(IsEditorDataAvailable());
|
||||
|
||||
nsTArray<OwningNonNull<nsINode>> arrayOfNodes;
|
||||
// GetNodesFromPoint is the workhorse that figures out what we wnat to move.
|
||||
nsresult rv = GetNodesFromPoint(EditorDOMPoint(&aRightBlock, aRightOffset),
|
||||
EditSubAction::eCreateOrChangeList,
|
||||
arrayOfNodes, TouchContent::yes);
|
||||
AutoTArray<OwningNonNull<nsINode>, 64> arrayOfNodes;
|
||||
nsresult rv = MOZ_KnownLive(HTMLEditorRef())
|
||||
.SplitInlinesAndCollectEditTargetNodesInOneHardLine(
|
||||
EditorDOMPoint(&aRightBlock, aRightOffset),
|
||||
arrayOfNodes, EditSubAction::eCreateOrChangeList);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return EditActionIgnored(rv);
|
||||
}
|
||||
|
@ -7892,59 +7892,6 @@ nsIContent* HTMLEditor::GetMostAncestorInlineElement(nsINode& aNode) const {
|
|||
return content;
|
||||
}
|
||||
|
||||
nsresult HTMLEditRules::GetNodesFromPoint(
|
||||
const EditorDOMPoint& aPoint, EditSubAction aEditSubAction,
|
||||
nsTArray<OwningNonNull<nsINode>>& outArrayOfNodes,
|
||||
TouchContent aTouchContent) const {
|
||||
if (NS_WARN_IF(!aPoint.IsSet())) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
RefPtr<nsRange> range;
|
||||
switch (aEditSubAction) {
|
||||
case EditSubAction::eInsertText:
|
||||
case EditSubAction::eInsertTextComingFromIME:
|
||||
case EditSubAction::eInsertLineBreak:
|
||||
case EditSubAction::eInsertParagraphSeparator:
|
||||
case EditSubAction::eDeleteText:
|
||||
range = HTMLEditorRef().CreateRangeIncludingAdjuscentWhiteSpaces(
|
||||
aPoint.ToRawRangeBoundary(), aPoint.ToRawRangeBoundary());
|
||||
break;
|
||||
default:
|
||||
range = HTMLEditorRef().CreateRangeExtendedToHardLineStartAndEnd(
|
||||
aPoint.ToRawRangeBoundary(), aPoint.ToRawRangeBoundary(),
|
||||
aEditSubAction);
|
||||
break;
|
||||
}
|
||||
if (!range) {
|
||||
ErrorResult error;
|
||||
range = nsRange::Create(aPoint.ToRawRangeBoundary(),
|
||||
aPoint.ToRawRangeBoundary(), error);
|
||||
if (NS_WARN_IF(error.Failed())) {
|
||||
return error.StealNSResult();
|
||||
}
|
||||
}
|
||||
|
||||
// Make array of ranges
|
||||
nsTArray<RefPtr<nsRange>> arrayOfRanges;
|
||||
|
||||
// Stuff new opRange into array
|
||||
arrayOfRanges.AppendElement(range);
|
||||
|
||||
if (aTouchContent == TouchContent::yes) {
|
||||
nsresult rv = MOZ_KnownLive(HTMLEditorRef())
|
||||
.SplitInlinesAndCollectEditTargetNodes(
|
||||
arrayOfRanges, outArrayOfNodes, aEditSubAction);
|
||||
NS_WARNING_ASSERTION(NS_SUCCEEDED(rv),
|
||||
"SplitInlinesAndCollectEditTargetNodes() failed");
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsresult rv = HTMLEditorRef().CollectEditTargetNodes(
|
||||
arrayOfRanges, outArrayOfNodes, aEditSubAction);
|
||||
NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), "CollectEditTargetNodes() failed");
|
||||
return rv;
|
||||
}
|
||||
|
||||
void HTMLEditRules::MakeTransitionList(
|
||||
nsTArray<OwningNonNull<nsINode>>& aNodeArray,
|
||||
nsTArray<bool>& aTransitionArray) {
|
||||
|
|
|
@ -790,17 +790,6 @@ class HTMLEditRules : public TextEditRules {
|
|||
nsINode& aNode, nsTArray<OwningNonNull<nsINode>>& outArrayOfNodes);
|
||||
|
||||
enum class TouchContent { no, yes };
|
||||
|
||||
/**
|
||||
* GetNodesFromPoint() constructs a list of nodes from a point that will be
|
||||
* operated on.
|
||||
*/
|
||||
MOZ_CAN_RUN_SCRIPT
|
||||
MOZ_MUST_USE nsresult
|
||||
GetNodesFromPoint(const EditorDOMPoint& aPoint, EditSubAction aEditSubAction,
|
||||
nsTArray<OwningNonNull<nsINode>>& outArrayOfNodes,
|
||||
TouchContent aTouchContent) const;
|
||||
|
||||
enum class EntireList { no, yes };
|
||||
MOZ_CAN_RUN_SCRIPT
|
||||
MOZ_MUST_USE nsresult
|
||||
|
|
|
@ -1296,9 +1296,10 @@ class HTMLEditor final : public TextEditor,
|
|||
* elements around aArrayOfRanges. Then, collects edit target nodes to
|
||||
* aOutArrayOfNodes. Finally, each edit target nodes is split at every
|
||||
* <br> element in it.
|
||||
* FYI: You can use
|
||||
* SplitInlinesAndCollectEditTargetNodesInExtendedSelectionRanges()
|
||||
* instead if you want to call this with extended selection ranges.
|
||||
* FYI: You can use SplitInlinesAndCollectEditTargetNodesInOneHardLine()
|
||||
* or SplitInlinesAndCollectEditTargetNodesInExtendedSelectionRanges()
|
||||
* instead if you want to call this with a hard line including
|
||||
* specific DOM point or extended selection ranges.
|
||||
*/
|
||||
MOZ_CAN_RUN_SCRIPT MOZ_MUST_USE nsresult
|
||||
SplitInlinesAndCollectEditTargetNodes(
|
||||
|
@ -1431,6 +1432,44 @@ class HTMLEditor final : public TextEditor,
|
|||
return rv;
|
||||
}
|
||||
|
||||
/**
|
||||
* SplitInlinesAndCollectEditTargetNodesInOneHardLine() just calls
|
||||
* SplitInlinesAndCollectEditTargetNodes() with result of calling
|
||||
* CreateRangeExtendedToHardLineStartAndEnd() with aPointInOneHardLine.
|
||||
* In other words, returns nodes in the hard line including
|
||||
* `aPointInOneHardLine`. See the comments for these methods for the
|
||||
* detail.
|
||||
*/
|
||||
MOZ_CAN_RUN_SCRIPT MOZ_MUST_USE nsresult
|
||||
SplitInlinesAndCollectEditTargetNodesInOneHardLine(
|
||||
const EditorDOMPoint& aPointInOneHardLine,
|
||||
nsTArray<OwningNonNull<nsINode>>& aOutArrayOfNodes,
|
||||
EditSubAction aEditSubAction) {
|
||||
if (NS_WARN_IF(!aPointInOneHardLine.IsSet())) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
RefPtr<nsRange> oneLineRange = CreateRangeExtendedToHardLineStartAndEnd(
|
||||
aPointInOneHardLine.ToRawRangeBoundary(),
|
||||
aPointInOneHardLine.ToRawRangeBoundary(), aEditSubAction);
|
||||
if (!oneLineRange) {
|
||||
// XXX It seems odd to create collapsed range for one line range...
|
||||
ErrorResult error;
|
||||
oneLineRange =
|
||||
nsRange::Create(aPointInOneHardLine.ToRawRangeBoundary(),
|
||||
aPointInOneHardLine.ToRawRangeBoundary(), error);
|
||||
if (NS_WARN_IF(error.Failed())) {
|
||||
return error.StealNSResult();
|
||||
}
|
||||
}
|
||||
AutoTArray<RefPtr<nsRange>, 1> arrayOfLineRanges;
|
||||
arrayOfLineRanges.AppendElement(oneLineRange);
|
||||
nsresult rv = SplitInlinesAndCollectEditTargetNodes(
|
||||
arrayOfLineRanges, aOutArrayOfNodes, aEditSubAction);
|
||||
NS_WARNING_ASSERTION(NS_SUCCEEDED(rv),
|
||||
"SplitInlinesAndCollectEditTargetNodes() failed");
|
||||
return rv;
|
||||
}
|
||||
|
||||
/**
|
||||
* CollectEditTargetNodesInExtendedSelectionRanges() calls
|
||||
* CollectEditTargetNodes() with result of
|
||||
|
|
|
@ -312,14 +312,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
|
||||
[[package]]
|
||||
name = "crossbeam-channel"
|
||||
version = "0.2.4"
|
||||
version = "0.3.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"crossbeam-epoch 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parking_lot 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"smallvec 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -345,19 +341,6 @@ dependencies = [
|
|||
"scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam-epoch"
|
||||
version = "0.5.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam-utils"
|
||||
version = "0.2.2"
|
||||
|
@ -368,8 +351,12 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "crossbeam-utils"
|
||||
version = "0.5.0"
|
||||
version = "0.6.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cstr"
|
||||
|
@ -756,19 +743,19 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "ipc-channel"
|
||||
version = "0.11.0"
|
||||
version = "0.12.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"bincode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-channel 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-channel 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.88 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tempfile 3.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"uuid 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -1091,15 +1078,6 @@ dependencies = [
|
|||
"stable_deref_trait 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "parking_lot"
|
||||
version = "0.6.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"lock_api 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "parking_lot"
|
||||
version = "0.7.1"
|
||||
|
@ -1109,17 +1087,6 @@ dependencies = [
|
|||
"parking_lot_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "parking_lot_core"
|
||||
version = "0.2.14"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"smallvec 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "parking_lot_core"
|
||||
version = "0.4.0"
|
||||
|
@ -1224,18 +1191,6 @@ dependencies = [
|
|||
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rand"
|
||||
version = "0.5.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rand"
|
||||
version = "0.6.5"
|
||||
|
@ -1263,14 +1218,6 @@ dependencies = [
|
|||
"rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rand_core"
|
||||
version = "0.2.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rand_core"
|
||||
version = "0.3.1"
|
||||
|
@ -1786,11 +1733,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
|
||||
[[package]]
|
||||
name = "uuid"
|
||||
version = "0.6.5"
|
||||
version = "0.7.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -1933,7 +1879,7 @@ dependencies = [
|
|||
"core-graphics 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"derive_more 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"malloc_size_of_derive 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"peek-poke 0.2.0",
|
||||
"serde 1.0.88 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -2168,12 +2114,11 @@ dependencies = [
|
|||
"checksum core-text 13.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f3f46450d6f2397261af420b4ccce23807add2e45fa206410a03d66fb7f050ae"
|
||||
"checksum crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1"
|
||||
"checksum crossbeam 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)" = "bd66663db5a988098a89599d4857919b3acf7f61402e61365acfd3919857b9be"
|
||||
"checksum crossbeam-channel 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "6c0a94250b0278d7fc5a894c3d276b11ea164edc8bf8feb10ca1ea517b44a649"
|
||||
"checksum crossbeam-channel 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "c8ec7fcd21571dc78f96cc96243cab8d8f035247c3efd16c687be154c3fa9efa"
|
||||
"checksum crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f739f8c5363aca78cfb059edf753d8f0d36908c348f3d8d1503f03d8b75d9cf3"
|
||||
"checksum crossbeam-epoch 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "927121f5407de9956180ff5e936fe3cf4324279280001cd56b669d28ee7e9150"
|
||||
"checksum crossbeam-epoch 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "30fecfcac6abfef8771151f8be4abc9e4edc112c2bcb233314cafde2680536e9"
|
||||
"checksum crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2760899e32a1d58d5abb31129f8fae5de75220bc2176e77ff7c627ae45c918d9"
|
||||
"checksum crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "677d453a17e8bd2b913fa38e8b9cf04bcdbb5be790aa294f2389661d72036015"
|
||||
"checksum crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6"
|
||||
"checksum cstr 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ee681252c9c0a6e84bbb53257faa3d88a49ce6fb32148ae1a9dc24b588302a71"
|
||||
"checksum cstr-macros 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5e700cd6ede9b3f81b23ce4cba15f75cc8bf5b5a5dce2db293b1d31f4950ed78"
|
||||
"checksum deflate 0.7.18 (registry+https://github.com/rust-lang/crates.io-index)" = "32c8120d981901a9970a3a1c97cf8b630e0fa8c3ca31e75b6fd6fd5f9f427b31"
|
||||
|
@ -2216,7 +2161,7 @@ dependencies = [
|
|||
"checksum image 0.22.1 (registry+https://github.com/rust-lang/crates.io-index)" = "663a975007e0b49903e2e8ac0db2c432c465855f2d65f17883ba1476e85f0b42"
|
||||
"checksum inflate 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4ec18d981200fd14e65ee8e35fb60ed1ce55227a02407303f3a72517c6146dcc"
|
||||
"checksum iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe6e417e7d0975db6512b90796e8ce223145ac4e33c377e4a42882a0e88bb08"
|
||||
"checksum ipc-channel 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dd75debad4ffd295c00c6e3634d254df30050b0837a85e5cd039ac424365f24a"
|
||||
"checksum ipc-channel 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "79d98ee7dd1d2e796d254807fd86ea7189d07571aeaa74007603e29a79d15217"
|
||||
"checksum itoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c069bbec61e1ca5a596166e55dfe4773ff745c3d16b700013bcaff9a6df2c682"
|
||||
"checksum jpeg-decoder 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "0dfe27a6c0dabd772d0f9b9f8701c4ca12c4d1eebcadf2be1f6f70396f6a1434"
|
||||
"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
|
||||
|
@ -2258,9 +2203,7 @@ dependencies = [
|
|||
"checksum osmesa-src 0.1.1 (git+https://github.com/servo/osmesa-src)" = "<none>"
|
||||
"checksum osmesa-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "88cfece6e95d2e717e0872a7f53a8684712ad13822a7979bc760b9c77ec0013b"
|
||||
"checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37"
|
||||
"checksum parking_lot 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "69376b761943787ebd5cc85a5bc95958651a22609c5c1c2b65de21786baec72b"
|
||||
"checksum parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ab41b4aed082705d1056416ae4468b6ea99d52599ecf3169b00088d43113e337"
|
||||
"checksum parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "4db1a8ccf734a7bce794cc19b3df06ed87ab2f3907036b693c68f56b4d4537fa"
|
||||
"checksum parking_lot_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "94c8c7923936b28d546dfd14d4472eaf34c99b14e1c973a32b3e6d4eb04298c9"
|
||||
"checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831"
|
||||
"checksum percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e"
|
||||
|
@ -2272,10 +2215,8 @@ dependencies = [
|
|||
"checksum quick-error 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eda5fe9b71976e62bc81b781206aaa076401769b2143379d3eb2118388babac4"
|
||||
"checksum quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)" = "faf4799c5d274f3868a4aae320a0a182cbd2baee377b378f080e16a23e9d80db"
|
||||
"checksum rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "eba5f8cb59cc50ed56be8880a5c7b496bfd9bd26394e176bc67884094145c2c5"
|
||||
"checksum rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e464cd887e869cddcae8792a4ee31d23c7edd516700695608f5b98c67ee0131c"
|
||||
"checksum rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca"
|
||||
"checksum rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef"
|
||||
"checksum rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1961a422c4d189dfb50ffa9320bf1f2a9bd54ecb92792fb9477f99a1045f3372"
|
||||
"checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b"
|
||||
"checksum rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d0e7a549d590831370895ab7ba4ea0c1b6b011d106b5ff2da6eee112615e6dc0"
|
||||
"checksum rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4"
|
||||
|
@ -2338,7 +2279,7 @@ dependencies = [
|
|||
"checksum url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "75b414f6c464c879d7f9babf951f23bc3743fb7313c081b2e6ca719067ea9d61"
|
||||
"checksum user32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ef4711d107b21b410a3a974b1204d9accc8b10dad75d8324b5d755de1617d47"
|
||||
"checksum utf8-ranges 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "796f7e48bef87609f7ade7e06495a87d5cd06c7866e6a5cbfceffc558a243737"
|
||||
"checksum uuid 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e1436e58182935dcd9ce0add9ea0b558e8a87befe01c1a301e6020aeb0876363"
|
||||
"checksum uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)" = "90dbc611eb48397705a6b0f6e917da23ae517e4d127123d2cf7674206627d32a"
|
||||
"checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a"
|
||||
"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
|
||||
"checksum walkdir 2.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "c7904a7e2bb3cdf0cf5e783f44204a85a37a93151738fa349f06680f59a98b45"
|
||||
|
|
|
@ -6,14 +6,11 @@ check-alphabetical-order = false
|
|||
[ignore]
|
||||
# Ignored packages with duplicated versions
|
||||
packages = [
|
||||
"crossbeam-epoch",
|
||||
"crossbeam-utils",
|
||||
"gl_generator",
|
||||
"khronos_api",
|
||||
"lazy_static",
|
||||
"nix",
|
||||
"parking_lot",
|
||||
"parking_lot_core",
|
||||
"percent-encoding",
|
||||
"rand",
|
||||
"rand_core",
|
||||
|
|
|
@ -19,7 +19,7 @@ app_units = "0.7"
|
|||
bitflags = "1.0"
|
||||
byteorder = "1.2.1"
|
||||
derive_more = "0.13"
|
||||
ipc-channel = {version = "0.11.0", optional = true}
|
||||
ipc-channel = {version = "0.12.0", optional = true}
|
||||
euclid = { version = "0.20.0", features = ["serde"] }
|
||||
malloc_size_of_derive = "0.1"
|
||||
serde = { version = "=1.0.88", features = ["rc"] }
|
||||
|
|
|
@ -320,13 +320,15 @@ void ScrollAnchorContainer::Destroy() {
|
|||
void ScrollAnchorContainer::ApplyAdjustments() {
|
||||
if (!mAnchorNode || mAnchorNodeIsDirty ||
|
||||
mScrollFrame->HasPendingScrollRestoration() ||
|
||||
mScrollFrame->IsProcessingScrollEvent() ||
|
||||
mScrollFrame->IsProcessingAsyncScroll()) {
|
||||
mSuppressAnchorAdjustment = false;
|
||||
ANCHOR_LOG(
|
||||
"Ignoring post-reflow (anchor=%p, dirty=%d, pendingRestoration=%d, "
|
||||
"asyncScroll=%d container=%p).\n",
|
||||
"scrollevent=%d asyncScroll=%d container=%p).\n",
|
||||
mAnchorNode, mAnchorNodeIsDirty,
|
||||
mScrollFrame->HasPendingScrollRestoration(),
|
||||
mScrollFrame->IsProcessingScrollEvent(),
|
||||
mScrollFrame->IsProcessingAsyncScroll(), this);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -12440,19 +12440,16 @@ void ReflowInput::DisplayInitFrameTypeExit(nsIFrame* aFrame,
|
|||
DR_state->DisplayFrameTypeInfo(aFrame, treeNode->mIndent);
|
||||
printf("InitFrameType");
|
||||
|
||||
const nsStyleDisplay* disp = aState->mStyleDisplay;
|
||||
|
||||
if (aFrame->GetStateBits() & NS_FRAME_OUT_OF_FLOW) printf(" out-of-flow");
|
||||
if (aFrame->GetPrevInFlow()) printf(" prev-in-flow");
|
||||
if (aFrame->IsAbsolutelyPositioned()) printf(" abspos");
|
||||
if (aFrame->IsFloating()) printf(" float");
|
||||
|
||||
const nsCSSKeyword displayVal = nsCSSProps::ValueToKeywordEnum(
|
||||
disp->mDisplay, nsCSSProps::kDisplayKTable);
|
||||
if (displayVal == eCSSKeyword_UNKNOWN)
|
||||
printf(" display=%u", static_cast<uint32_t>(disp->mDisplay));
|
||||
else
|
||||
printf(" display=%s", nsCSSKeywords::GetStringValue(displayVal).get());
|
||||
{
|
||||
nsAutoString result;
|
||||
Servo_GetPropertyValue(aFrame->Style(), eCSSProperty_display, &result);
|
||||
printf(" display=%s", NS_ConvertUTF16toUTF8(result).get());
|
||||
}
|
||||
|
||||
// This array must exactly match the NS_CSS_FRAME_TYPE constants.
|
||||
const char* const cssFrameTypes[] = {
|
||||
|
|
|
@ -2114,6 +2114,7 @@ ScrollFrameHelper::ScrollFrameHelper(nsContainerFrame* aOuter, bool aIsRoot)
|
|||
mSuppressScrollbarRepaints(false),
|
||||
mIsUsingMinimumScaleSize(false),
|
||||
mMinimumScaleSizeChanged(false),
|
||||
mProcessingScrollEvent(false),
|
||||
mVelocityQueue(aOuter->PresContext()) {
|
||||
if (LookAndFeel::GetInt(LookAndFeel::eIntID_UseOverlayScrollbars) != 0) {
|
||||
mScrollbarActivity = new ScrollbarActivity(do_QueryFrame(aOuter));
|
||||
|
@ -5227,6 +5228,16 @@ void ScrollFrameHelper::FireScrollEvent() {
|
|||
return;
|
||||
}
|
||||
|
||||
bool oldProcessing = mProcessingScrollEvent;
|
||||
AutoWeakFrame weakFrame(mOuter);
|
||||
auto RestoreProcessingScrollEvent = mozilla::MakeScopeExit([&] {
|
||||
if (weakFrame.IsAlive()) { // Otherwise `this` will be dead too.
|
||||
mProcessingScrollEvent = oldProcessing;
|
||||
}
|
||||
});
|
||||
|
||||
mProcessingScrollEvent = true;
|
||||
|
||||
ActiveLayerTracker::SetCurrentScrollHandlerFrame(mOuter);
|
||||
WidgetGUIEvent event(true, eScroll, nullptr);
|
||||
nsEventStatus status = nsEventStatus_eIgnore;
|
||||
|
|
|
@ -205,6 +205,8 @@ class ScrollFrameHelper : public nsIReflowCallback {
|
|||
return mRestorePos != nsPoint(-1, -1);
|
||||
}
|
||||
|
||||
bool IsProcessingScrollEvent() const { return mProcessingScrollEvent; }
|
||||
|
||||
protected:
|
||||
nsRect GetVisualScrollRange() const;
|
||||
|
||||
|
@ -700,6 +702,9 @@ class ScrollFrameHelper : public nsIReflowCallback {
|
|||
// True if the minimum scale size has been changed since the last reflow.
|
||||
bool mMinimumScaleSizeChanged : 1;
|
||||
|
||||
// True if we're processing an scroll event.
|
||||
bool mProcessingScrollEvent : 1;
|
||||
|
||||
mozilla::layout::ScrollVelocityQueue mVelocityQueue;
|
||||
|
||||
protected:
|
||||
|
|
|
@ -219,52 +219,6 @@ const KTableEntry nsCSSProps::kCursorKTable[] = {
|
|||
{eCSSKeyword__moz_zoom_out, StyleCursorKind::ZoomOut},
|
||||
{eCSSKeyword_UNKNOWN, nsCSSKTableEntry::SENTINEL_VALUE}};
|
||||
|
||||
KTableEntry nsCSSProps::kDisplayKTable[] = {
|
||||
{eCSSKeyword_none, StyleDisplay::None},
|
||||
{eCSSKeyword_inline, StyleDisplay::Inline},
|
||||
{eCSSKeyword_block, StyleDisplay::Block},
|
||||
{eCSSKeyword_inline_block, StyleDisplay::InlineBlock},
|
||||
{eCSSKeyword_list_item, StyleDisplay::ListItem},
|
||||
{eCSSKeyword_table, StyleDisplay::Table},
|
||||
{eCSSKeyword_inline_table, StyleDisplay::InlineTable},
|
||||
{eCSSKeyword_table_row_group, StyleDisplay::TableRowGroup},
|
||||
{eCSSKeyword_table_header_group, StyleDisplay::TableHeaderGroup},
|
||||
{eCSSKeyword_table_footer_group, StyleDisplay::TableFooterGroup},
|
||||
{eCSSKeyword_table_row, StyleDisplay::TableRow},
|
||||
{eCSSKeyword_table_column_group, StyleDisplay::TableColumnGroup},
|
||||
{eCSSKeyword_table_column, StyleDisplay::TableColumn},
|
||||
{eCSSKeyword_table_cell, StyleDisplay::TableCell},
|
||||
{eCSSKeyword_table_caption, StyleDisplay::TableCaption},
|
||||
// Make sure this is kept in sync with the code in
|
||||
// nsCSSFrameConstructor::ConstructXULFrame
|
||||
{eCSSKeyword__moz_box, StyleDisplay::MozBox},
|
||||
{eCSSKeyword__moz_inline_box, StyleDisplay::MozInlineBox},
|
||||
#ifdef MOZ_XUL
|
||||
{eCSSKeyword__moz_grid, StyleDisplay::MozGrid},
|
||||
{eCSSKeyword__moz_grid_group, StyleDisplay::MozGridGroup},
|
||||
{eCSSKeyword__moz_grid_line, StyleDisplay::MozGridLine},
|
||||
{eCSSKeyword__moz_stack, StyleDisplay::MozStack},
|
||||
{eCSSKeyword__moz_deck, StyleDisplay::MozDeck},
|
||||
{eCSSKeyword__moz_popup, StyleDisplay::MozPopup},
|
||||
{eCSSKeyword__moz_groupbox, StyleDisplay::MozGroupbox},
|
||||
#endif
|
||||
{eCSSKeyword_flex, StyleDisplay::Flex},
|
||||
{eCSSKeyword_inline_flex, StyleDisplay::InlineFlex},
|
||||
{eCSSKeyword_ruby, StyleDisplay::Ruby},
|
||||
{eCSSKeyword_ruby_base, StyleDisplay::RubyBase},
|
||||
{eCSSKeyword_ruby_base_container, StyleDisplay::RubyBaseContainer},
|
||||
{eCSSKeyword_ruby_text, StyleDisplay::RubyText},
|
||||
{eCSSKeyword_ruby_text_container, StyleDisplay::RubyTextContainer},
|
||||
{eCSSKeyword_grid, StyleDisplay::Grid},
|
||||
{eCSSKeyword_inline_grid, StyleDisplay::InlineGrid},
|
||||
{eCSSKeyword__webkit_box, StyleDisplay::WebkitBox},
|
||||
{eCSSKeyword__webkit_inline_box, StyleDisplay::WebkitInlineBox},
|
||||
{eCSSKeyword__webkit_flex, StyleDisplay::Flex},
|
||||
{eCSSKeyword__webkit_inline_flex, StyleDisplay::InlineFlex},
|
||||
{eCSSKeyword_contents, StyleDisplay::Contents},
|
||||
{eCSSKeyword_flow_root, StyleDisplay::FlowRoot},
|
||||
{eCSSKeyword_UNKNOWN, nsCSSKTableEntry::SENTINEL_VALUE}};
|
||||
|
||||
const KTableEntry nsCSSProps::kFontSmoothingKTable[] = {
|
||||
{eCSSKeyword_auto, NS_FONT_SMOOTHING_AUTO},
|
||||
{eCSSKeyword_grayscale, NS_FONT_SMOOTHING_GRAYSCALE},
|
||||
|
|
|
@ -290,9 +290,6 @@ class nsCSSProps {
|
|||
|
||||
// Keyword/Enum value tables
|
||||
static const KTableEntry kCursorKTable[];
|
||||
// Not const because we modify its entries when various
|
||||
// "layout.css.*.enabled" prefs changes:
|
||||
static KTableEntry kDisplayKTable[];
|
||||
static const KTableEntry kFontSmoothingKTable[];
|
||||
static const KTableEntry kTextAlignKTable[];
|
||||
static const KTableEntry kTextDecorationStyleKTable[];
|
||||
|
|
|
@ -3382,6 +3382,8 @@ nsresult Http2Session::WriteSegmentsAgain(nsAHttpSegmentWriter* writer,
|
|||
streamCleanupCode = NS_ERROR_NET_RESET;
|
||||
mInputFrameDataStream->Transaction()->ReuseConnectionOnRestartOK(true);
|
||||
mInputFrameDataStream->Transaction()->DisableSpdy();
|
||||
mInputFrameDataStream->Transaction()
|
||||
->MakeNonSticky(); // actully allow restart by unsticking
|
||||
} else {
|
||||
streamCleanupCode = mInputFrameDataStream->RecvdData()
|
||||
? NS_ERROR_NET_PARTIAL_TRANSFER
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include "nsComponentManagerUtils.h"
|
||||
#include "nsSocketTransport2.h"
|
||||
#include "nsSocketTransportService2.h"
|
||||
#include "mozilla/AutoRestore.h"
|
||||
#include "mozilla/Mutex.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
@ -46,6 +47,8 @@ TLSFilterTransaction::TLSFilterTransaction(nsAHttpTransaction* aWrapped,
|
|||
mSegmentReader(aReader),
|
||||
mSegmentWriter(aWriter),
|
||||
mFilterReadCode(NS_ERROR_NOT_INITIALIZED),
|
||||
mFilterReadAmount(0),
|
||||
mInOnReadSegment(false),
|
||||
mForce(false),
|
||||
mReadSegmentReturnValue(NS_OK),
|
||||
mCloseReason(NS_ERROR_UNEXPECTED),
|
||||
|
@ -100,6 +103,11 @@ TLSFilterTransaction::TLSFilterTransaction(nsAHttpTransaction* aWrapped,
|
|||
|
||||
TLSFilterTransaction::~TLSFilterTransaction() {
|
||||
LOG(("TLSFilterTransaction dtor %p\n", this));
|
||||
|
||||
// Prevent call to OnReadSegment from FilterOutput, our mSegmentReader is now
|
||||
// an invalid pointer.
|
||||
mInOnReadSegment = true;
|
||||
|
||||
Cleanup();
|
||||
}
|
||||
|
||||
|
@ -199,6 +207,11 @@ nsresult TLSFilterTransaction::OnReadSegment(const char* aData, uint32_t aCount,
|
|||
|
||||
EnsureBuffer(mEncryptedText, aCount + 4096, 0, mEncryptedTextSize);
|
||||
|
||||
// Prevents call to OnReadSegment from inside FilterOutput, as we handle it
|
||||
// here.
|
||||
AutoRestore<bool> inOnReadSegment(mInOnReadSegment);
|
||||
mInOnReadSegment = true;
|
||||
|
||||
while (aCount > 0) {
|
||||
int32_t written = PR_Write(mFD, aData, aCount);
|
||||
LOG(("TLSFilterTransaction %p OnReadSegment PRWrite(%d) = %d %d\n", this,
|
||||
|
@ -240,7 +253,8 @@ nsresult TLSFilterTransaction::OnReadSegment(const char* aData, uint32_t aCount,
|
|||
// return OK because all the data was consumed and stored in this buffer
|
||||
Connection()->TransactionHasDataToWrite(this);
|
||||
return NS_OK;
|
||||
} else if (NS_FAILED(rv)) {
|
||||
}
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
|
@ -262,6 +276,19 @@ int32_t TLSFilterTransaction::FilterOutput(const char* aBuf, int32_t aAmount) {
|
|||
mEncryptedTextSize);
|
||||
memcpy(&mEncryptedText[mEncryptedTextUsed], aBuf, aAmount);
|
||||
mEncryptedTextUsed += aAmount;
|
||||
|
||||
LOG(("TLSFilterTransaction::FilterOutput %p %d buffered=%u mSegmentReader=%p",
|
||||
this, aAmount, mEncryptedTextUsed, mSegmentReader));
|
||||
|
||||
if (!mInOnReadSegment) {
|
||||
// When called externally, we must make sure any newly written data is
|
||||
// actually sent to the higher level connection.
|
||||
// This also covers the case when PR_Read() wrote a re-negotioation
|
||||
// response.
|
||||
uint32_t notUsed;
|
||||
Unused << OnReadSegment("", 0, ¬Used);
|
||||
}
|
||||
|
||||
return aAmount;
|
||||
}
|
||||
|
||||
|
@ -289,10 +316,22 @@ nsresult TLSFilterTransaction::OnWriteSegment(char* aData, uint32_t aCount,
|
|||
// this will call through to FilterInput to get data from the higher
|
||||
// level connection before removing the local TLS layer
|
||||
mFilterReadCode = NS_OK;
|
||||
mFilterReadAmount = 0;
|
||||
int32_t bytesRead = PR_Read(mFD, aData, aCount);
|
||||
if (bytesRead == -1) {
|
||||
PRErrorCode code = PR_GetError();
|
||||
if (code == PR_WOULD_BLOCK_ERROR) {
|
||||
LOG(
|
||||
("TLSFilterTransaction::OnWriteSegment %p PR_Read would block, "
|
||||
"actual read: %d\n",
|
||||
this, mFilterReadAmount));
|
||||
|
||||
if (mFilterReadAmount == 0 && NS_SUCCEEDED(mFilterReadCode)) {
|
||||
// No reading happened, but also no error occured, hence there is no
|
||||
// condition to break the `again` loop, propagate WOULD_BLOCK through
|
||||
// mFilterReadCode to break it and poll the socket again for reading.
|
||||
mFilterReadCode = NS_BASE_STREAM_WOULD_BLOCK;
|
||||
}
|
||||
return NS_BASE_STREAM_WOULD_BLOCK;
|
||||
}
|
||||
// If reading from the socket succeeded (NS_SUCCEEDED(mFilterReadCode)),
|
||||
|
@ -336,6 +375,8 @@ int32_t TLSFilterTransaction::FilterInput(char* aBuf, int32_t aAmount) {
|
|||
if (mReadSegmentReturnValue == NS_BASE_STREAM_WOULD_BLOCK) {
|
||||
mNudgeCounter = 0;
|
||||
}
|
||||
|
||||
mFilterReadAmount += outCountRead;
|
||||
}
|
||||
if (mFilterReadCode == NS_BASE_STREAM_WOULD_BLOCK) {
|
||||
PR_SetError(PR_WOULD_BLOCK_ERROR, 0);
|
||||
|
@ -357,6 +398,10 @@ nsresult TLSFilterTransaction::ReadSegments(nsAHttpSegmentReader* aReader,
|
|||
mReadSegmentReturnValue = NS_OK;
|
||||
mSegmentReader = aReader;
|
||||
nsresult rv = mTransaction->ReadSegments(this, aCount, outCountRead);
|
||||
|
||||
// mSegmentReader is left assigned (not nullified) because we want to be able
|
||||
// to call OnReadSegment directly, it expects mSegmentReader be non-null.
|
||||
|
||||
LOG(("TLSFilterTransaction %p called trans->ReadSegments rv=%" PRIx32 " %d\n",
|
||||
this, static_cast<uint32_t>(rv), *outCountRead));
|
||||
if (NS_SUCCEEDED(rv) &&
|
||||
|
|
|
@ -186,6 +186,10 @@ class TLSFilterTransaction final : public nsAHttpTransaction,
|
|||
nsAHttpSegmentWriter* mSegmentWriter;
|
||||
|
||||
nsresult mFilterReadCode;
|
||||
int32_t mFilterReadAmount;
|
||||
// Set only when we are calling PR_Write from inside OnReadSegment. Prevents
|
||||
// calling back to OnReadSegment from inside FilterOutput.
|
||||
bool mInOnReadSegment;
|
||||
bool mForce;
|
||||
nsresult mReadSegmentReturnValue;
|
||||
// Before Close() is called this is NS_ERROR_UNEXPECTED, in Close() we either
|
||||
|
|
|
@ -180,6 +180,7 @@ class nsAHttpTransaction : public nsSupportsWeakReference {
|
|||
}
|
||||
|
||||
virtual void DisableSpdy() {}
|
||||
virtual void MakeNonSticky() {}
|
||||
virtual void ReuseConnectionOnRestartOK(bool) {}
|
||||
|
||||
// Returns true if early-data or fast open is possible.
|
||||
|
|
|
@ -119,6 +119,7 @@ class nsHttpTransaction final : public nsAHttpTransaction,
|
|||
|
||||
void EnableKeepAlive() { mCaps |= NS_HTTP_ALLOW_KEEPALIVE; }
|
||||
void MakeSticky() { mCaps |= NS_HTTP_STICKY_CONNECTION; }
|
||||
void MakeNonSticky() override { mCaps &= ~NS_HTTP_STICKY_CONNECTION; }
|
||||
|
||||
// SetPriority() may only be used by the connection manager.
|
||||
void SetPriority(int32_t priority) { mPriority = priority; }
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
<!DOCTYPE html>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
|
||||
<link rel="author" title="Mozilla" href="https://mozilla.org">
|
||||
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1561450">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-scroll-anchoring/#suppression-triggers">
|
||||
<style>
|
||||
body { margin: 0 }
|
||||
.content {
|
||||
height: 45vh;
|
||||
background: lightblue;
|
||||
}
|
||||
</style>
|
||||
<div class="content"></div>
|
||||
<div id="hidden" style="display: none; height: 200px"></div>
|
||||
<div class="content"></div>
|
||||
<div class="content"></div>
|
||||
<div class="content"></div>
|
||||
<script>
|
||||
let first = true;
|
||||
const t = async_test("Scroll adjustments don't happen if triggered from scroll event listeners");
|
||||
onscroll = t.step_func(function() {
|
||||
assert_true(first, "Should only get one event");
|
||||
first = false;
|
||||
hidden.style.display = "block";
|
||||
hidden.offsetTop;
|
||||
hidden.style.display = "none";
|
||||
requestAnimationFrame(t.step_func(function() {
|
||||
requestAnimationFrame(t.step_func(function() {
|
||||
t.done();
|
||||
}));
|
||||
}));
|
||||
});
|
||||
window.onload = t.step_func(function() {
|
||||
window.scrollTo(0, document.scrollingElement.scrollTopMax - 200);
|
||||
});
|
||||
</script>
|
Загрузка…
Ссылка в новой задаче