mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1044181: style loader now annotates classified tracking nodes r=dbaron
This commit is contained in:
parent
3380ccba4c
commit
045244b07a
@ -808,6 +808,22 @@ SheetLoadData::OnStreamComplete(nsIUnicharStreamLoader* aLoader,
|
||||
|
||||
if (NS_FAILED(aStatus)) {
|
||||
LOG_WARN((" Load failed: status 0x%x", aStatus));
|
||||
// Handle sheet not loading error because source was a tracking URL.
|
||||
// We make a note of this sheet node by including it in a dedicated
|
||||
// array of blocked tracking nodes under its parent document.
|
||||
//
|
||||
// Multiple sheet load instances might be tied to this request,
|
||||
// we annotate each one linked to a valid owning element (node).
|
||||
if (aStatus == NS_ERROR_TRACKING_URI) {
|
||||
nsIDocument* doc = mLoader->GetDocument();
|
||||
if (doc) {
|
||||
for (SheetLoadData* data = this; data; data = data->mNext) {
|
||||
// mOwningElement may be null but AddBlockTrackingNode can cope
|
||||
nsCOMPtr<nsIContent> content = do_QueryInterface(data->mOwningElement);
|
||||
doc->AddBlockedTrackingNode(content);
|
||||
}
|
||||
}
|
||||
}
|
||||
mLoader->SheetComplete(this, aStatus);
|
||||
return NS_OK;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user