Merge autoland to central, a=merge

MozReview-Commit-ID: 1jc25nYhPbA
This commit is contained in:
Wes Kocher 2017-02-21 17:05:17 -08:00
Родитель 39e4b25a07 2d939c8b59
Коммит aa292f210f
151 изменённых файлов: 3637 добавлений и 1931 удалений

Просмотреть файл

@ -39,10 +39,27 @@ var gSafeBrowsing = {
/**
* Used to report a phishing page or a false positive
* @param name String One of "Phish", "Error", "Malware" or "MalwareError"
*
* @param name
* String One of "PhishMistake", "MalwareMistake", or "Phish"
* @param info
* Information about the reasons for blocking the resource.
* In the case false positive, it may contain SafeBrowsing
* matching list and provider of the list
* @return String the report phishing URL.
*/
getReportURL(name) {
return SafeBrowsing.getReportURL(name, gBrowser.currentURI);
getReportURL(name, info) {
let reportInfo = info;
if (!reportInfo) {
let pageUri = gBrowser.currentURI.clone();
// Remove the query to avoid including potentially sensitive data
if (pageUri instanceof Ci.nsIURL) {
pageUri.query = "";
}
reportInfo = { uri: pageUri.asciiSpec };
}
return SafeBrowsing.getReportURL(name, reportInfo);
}
}

Просмотреть файл

@ -2972,7 +2972,8 @@ var BrowserOnClick = {
break;
case "Browser:SiteBlockedError":
this.onAboutBlocked(msg.data.elementId, msg.data.reason,
msg.data.isTopFrame, msg.data.location);
msg.data.isTopFrame, msg.data.location,
msg.data.blockedInfo);
break;
case "Browser:EnableOnlineMode":
if (Services.io.offline) {
@ -3097,7 +3098,7 @@ var BrowserOnClick = {
}
},
onAboutBlocked(elementId, reason, isTopFrame, location) {
onAboutBlocked(elementId, reason, isTopFrame, location, blockedInfo) {
// Depending on what page we are displaying here (malware/phishing/unwanted)
// use the right strings and links for each.
let bucketName = "";
@ -3140,13 +3141,13 @@ var BrowserOnClick = {
if (sendTelemetry) {
secHistogram.add(nsISecTel[bucketName + "IGNORE_WARNING"]);
}
this.ignoreWarningButton(reason);
this.ignoreWarningButton(reason, blockedInfo);
}
break;
}
},
ignoreWarningButton(reason) {
ignoreWarningButton(reason, blockedInfo) {
// Allow users to override and continue through to the site,
// but add a notify bar as a reminder, so that they don't lose
// track after, e.g., tab switching.
@ -3166,23 +3167,33 @@ var BrowserOnClick = {
let title;
if (reason === "malware") {
title = gNavigatorBundle.getString("safebrowsing.reportedAttackSite");
buttons[1] = {
label: gNavigatorBundle.getString("safebrowsing.notAnAttackButton.label"),
accessKey: gNavigatorBundle.getString("safebrowsing.notAnAttackButton.accessKey"),
callback() {
openUILinkIn(gSafeBrowsing.getReportURL("MalwareMistake"), "tab");
}
};
let reportUrl = gSafeBrowsing.getReportURL("MalwareMistake", blockedInfo);
// There's no button if we can not get report url, for example if the provider
// of blockedInfo is not Google
if (reportUrl) {
buttons[1] = {
label: gNavigatorBundle.getString("safebrowsing.notAnAttackButton.label"),
accessKey: gNavigatorBundle.getString("safebrowsing.notAnAttackButton.accessKey"),
callback() {
openUILinkIn(reportUrl, "tab");
}
};
}
} else if (reason === "phishing") {
title = gNavigatorBundle.getString("safebrowsing.deceptiveSite");
buttons[1] = {
label: gNavigatorBundle.getString("safebrowsing.notADeceptiveSiteButton.label"),
accessKey: gNavigatorBundle.getString("safebrowsing.notADeceptiveSiteButton.accessKey"),
callback() {
openUILinkIn(gSafeBrowsing.getReportURL("PhishMistake"), "tab");
}
};
let reportUrl = gSafeBrowsing.getReportURL("PhishMistake", blockedInfo);
// There's no button if we can not get report url, for example if the provider
// of blockedInfo is not Google
if (reportUrl) {
buttons[1] = {
label: gNavigatorBundle.getString("safebrowsing.notADeceptiveSiteButton.label"),
accessKey: gNavigatorBundle.getString("safebrowsing.notADeceptiveSiteButton.accessKey"),
callback() {
openUILinkIn(reportUrl, "tab");
}
};
}
} else if (reason === "unwanted") {
title = gNavigatorBundle.getString("safebrowsing.reportedUnwantedSite");
// There is no button for reporting errors since Google doesn't currently

Просмотреть файл

@ -575,11 +575,36 @@ var ClickEventHandler = {
} else if (/e=unwantedBlocked/.test(ownerDoc.documentURI)) {
reason = "unwanted";
}
let docShell = ownerDoc.defaultView.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
let blockedInfo = {};
if (docShell.failedChannel) {
let classifiedChannel = docShell.failedChannel.
QueryInterface(Ci.nsIClassifiedChannel);
if (classifiedChannel) {
let httpChannel = docShell.failedChannel.QueryInterface(Ci.nsIHttpChannel);
let reportUri = httpChannel.URI.clone();
// Remove the query to avoid leaking sensitive data
if (reportUri instanceof Ci.nsIURL) {
reportUri.query = "";
}
blockedInfo = { list: classifiedChannel.matchedList,
provider: classifiedChannel.matchedProvider,
uri: reportUri.asciiSpec };
}
}
sendAsyncMessage("Browser:SiteBlockedError", {
location: ownerDoc.location.href,
reason,
elementId: targetElement.getAttribute("id"),
isTopFrame: (ownerDoc.defaultView.parent === ownerDoc.defaultView)
isTopFrame: (ownerDoc.defaultView.parent === ownerDoc.defaultView),
blockedInfo
});
},

Просмотреть файл

@ -13,12 +13,7 @@ add_task(function* checkBackFromInvalidURI() {
gURLBar.value = "::2600";
gURLBar.focus();
let promiseErrorPageLoaded = new Promise(resolve => {
tab.linkedBrowser.addEventListener("DOMContentLoaded", function onLoad() {
tab.linkedBrowser.removeEventListener("DOMContentLoaded", onLoad, false, true);
resolve();
}, false, true);
});
let promiseErrorPageLoaded = BrowserTestUtils.waitForErrorPage(tab.linkedBrowser);
EventUtils.synthesizeKey("VK_RETURN", {});
yield promiseErrorPageLoaded;

Просмотреть файл

@ -108,8 +108,12 @@ var observer = {
};
function waitForMozAfterPaint(win, callback) {
let dwu = win.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindowUtils);
let lastTransactionId = dwu.lastTransactionId;
win.addEventListener("MozAfterPaint", function onEnd(event) {
if (event.target != win)
if (event.target != win || event.transactionId <= lastTransactionId)
return;
win.removeEventListener("MozAfterPaint", onEnd);
executeSoon(callback);

Просмотреть файл

@ -100,12 +100,12 @@ var gTests = [
yield checkSharingUI({video: true, audio: true});
info("reloading the frame");
promise = promiseObserverCalled("recording-device-stopped");
let promises = [promiseObserverCalled("recording-device-stopped"),
promiseObserverCalled("recording-device-events"),
promiseObserverCalled("recording-window-ended")];
yield promiseReloadFrame("frame1");
yield promise;
yield Promise.all(promises);
yield expectObserverCalled("recording-device-events");
yield expectObserverCalled("recording-window-ended");
yield expectNoObserverCalled();
yield checkNotSharing();
}

Просмотреть файл

@ -223,7 +223,7 @@ FeedConverter.prototype = {
try {
let title = feed.title ? feed.title.plainText() : "";
let desc = feed.subtitle ? feed.subtitle.plainText() : "";
let feedReader = safeGetCharPref(getPrefActionForType(feedType), "bookmarks");
let feedReader = safeGetCharPref(getPrefActionForType(feed.type), "bookmarks");
feedService.addToClientReader(result.uri.spec, title, desc, feed.type, feedReader);
return;
} catch (ex) { /* fallback to preview mode */ }

Просмотреть файл

@ -3,6 +3,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* global BrowserFeedWriter */
var SubscribeHandler = {
/**
* The nsIFeedWriter object that produces the UI

Просмотреть файл

@ -54,6 +54,7 @@
</div>
<script type="application/javascript">
/* import-globals-from subscribe.js */
SubscribeHandler.init();
</script>

Просмотреть файл

@ -23,7 +23,7 @@ addLoadEvent(function() {
var doc = SpecialPowers.wrap($("testFrame")).contentDocument;
checkNode(doc.getElementById("feedTitleText"), [
"ELEMENT", "h1", { "xml:base": "http://www.example.com/foo/bar/" }, [
"ELEMENT", "h1", [
["TEXT", "Example of a "],
["ELEMENT", "em", [
["TEXT", "special"],
@ -35,7 +35,7 @@ addLoadEvent(function() {
]);
checkNode(doc.getElementById("feedSubtitleText"), [
"ELEMENT", "h2", { "xml:base": "http://www.example.com/foo/bar/" }, [
"ELEMENT", "h2", [
["TEXT", "With a "],
["ELEMENT", "em", [
["TEXT", "special"],
@ -47,7 +47,7 @@ addLoadEvent(function() {
]);
checkNode(doc.querySelector(".entry").firstChild.firstChild.firstChild, [
"ELEMENT", "span", { "xml:base": "http://www.example.com/foo/bar/" }, [
"ELEMENT", "span", [
["TEXT", "Some "],
["ELEMENT", "abbr", { title: "Extensible Hyper-text Mark-up Language" }, [
["TEXT", "XHTML"],
@ -59,7 +59,7 @@ addLoadEvent(function() {
]);
checkNode(doc.querySelectorAll(".entry")[1].firstChild.firstChild.firstChild, [
"ELEMENT", "span", { "xml:base": "http://www.example.com/foo/bar/" }, [
"ELEMENT", "span", [
["TEXT", "Some "],
["ELEMENT", "abbr", { title: "Hyper-text Mark-up Language" }, [
["TEXT", "HTML"],

Просмотреть файл

@ -4,6 +4,8 @@
'use strict';
const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
class Viewport {
constructor() {
this._viewerContainer = document.getElementById('viewerContainer');
@ -39,6 +41,7 @@ class Viewport {
this.onPasswordRequest = null;
this._viewportController.addEventListener('scroll', this);
this._viewportController.addEventListener('copy', this);
window.addEventListener('resize', this);
}
@ -475,6 +478,15 @@ class Viewport {
}
}
_copyToClipboard(text) {
if (!text) {
return;
}
const gClipboardHelper = Cc["@mozilla.org/widget/clipboardhelper;1"]
.getService(Ci.nsIClipboardHelper);
gClipboardHelper.copyString(text);
}
verifyPassword(password) {
this._doAction({
type: 'getPasswordComplete',
@ -495,6 +507,12 @@ class Viewport {
this._refresh();
}
break;
case 'copy':
this._doAction({
type: 'getSelectedText'
})
evt.preventDefault();
break;
}
}
@ -608,6 +626,11 @@ class Viewport {
case 'getPassword':
this.onPasswordRequest && this.onPasswordRequest();
break;
case 'getSelectedTextReply':
// For now this message is used only by text copy so we handle just
// that case.
this._copyToClipboard(message.selectedText);
break;
}
}
}

Просмотреть файл

@ -5611,6 +5611,14 @@ HTMLMediaElement::UpdateReadyStateInternal()
return;
}
// TextTracks must be loaded for the HAVE_ENOUGH_DATA and
// HAVE_FUTURE_DATA.
// So force HAVE_CURRENT_DATA if text tracks not loaded.
if (mTextTrackManager && !mTextTrackManager->IsLoaded()) {
ChangeReadyState(nsIDOMHTMLMediaElement::HAVE_CURRENT_DATA);
return;
}
if (mDownloadSuspendedByCache && mDecoder && !mDecoder->IsEnded()) {
// The decoder has signaled that the download has been suspended by the
// media cache. So move readyState into HAVE_ENOUGH_DATA, in case there's

Просмотреть файл

@ -392,6 +392,7 @@ HTMLTrackElement::UnbindFromTree(bool aDeep, bool aNullParent)
// called.
if (mTrack) {
mMediaParent->RemoveTextTrack(mTrack);
mMediaParent->UpdateReadyState();
}
mMediaParent = nullptr;
}

Просмотреть файл

@ -848,5 +848,12 @@ TextTrackManager::ReportTelemetryForCue()
}
}
bool
TextTrackManager::IsLoaded()
{
return mTextTracks ? mTextTracks->AreTextTracksLoaded() : true;
}
} // namespace dom
} // namespace mozilla

Просмотреть файл

@ -103,6 +103,8 @@ public:
void NotifyReset();
bool IsLoaded();
private:
/**
* Converts the TextTrackCue's cuetext into a tree of DOM objects

Просмотреть файл

@ -8,12 +8,13 @@
using struct mozilla::void_t from "ipc/IPCMessageUtils.h";
include protocol PContent;
include PURLClassifierInfo;
namespace mozilla {
namespace dom {
union MaybeResult {
nsresult;
union MaybeInfo {
ClassifierInfo;
void_t;
};
@ -22,7 +23,7 @@ protocol PURLClassifier
manager PContent;
child:
async __delete__(MaybeResult status);
async __delete__(MaybeInfo info, nsresult errorCode);
};
} // namespace dom

Просмотреть файл

@ -0,0 +1,17 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
namespace mozilla {
namespace dom {
struct ClassifierInfo {
nsCString list;
nsCString provider;
nsCString prefix;
};
} // namespace dom
} // namespace mozilla

Просмотреть файл

@ -6,15 +6,19 @@
#include "URLClassifierChild.h"
#include "nsComponentManagerUtils.h"
#include "nsIURI.h"
using namespace mozilla::dom;
mozilla::ipc::IPCResult
URLClassifierChild::Recv__delete__(const MaybeResult& aResult)
URLClassifierChild::Recv__delete__(const MaybeInfo& aInfo,
const nsresult& aResult)
{
MOZ_ASSERT(mCallback);
if (aResult.type() == MaybeResult::Tnsresult) {
mCallback->OnClassifyComplete(aResult.get_nsresult());
if (aInfo.type() == MaybeInfo::TClassifierInfo) {
mCallback->OnClassifyComplete(aResult, aInfo.get_ClassifierInfo().list(),
aInfo.get_ClassifierInfo().provider(),
aInfo.get_ClassifierInfo().prefix());
}
return IPC_OK();
}

Просмотреть файл

@ -22,7 +22,8 @@ class URLClassifierChild : public PURLClassifierChild
{
mCallback = aCallback;
}
mozilla::ipc::IPCResult Recv__delete__(const MaybeResult& aResult) override;
mozilla::ipc::IPCResult Recv__delete__(const MaybeInfo& aInfo,
const nsresult& aResult) override;
private:
~URLClassifierChild() = default;

Просмотреть файл

@ -42,10 +42,18 @@ URLClassifierParent::StartClassify(nsIPrincipal* aPrincipal,
}
nsresult
URLClassifierParent::OnClassifyComplete(nsresult aRv)
URLClassifierParent::OnClassifyComplete(nsresult aErrorCode,
const nsACString& aList,
const nsACString& aProvider,
const nsACString& aPrefix)
{
if (mIPCOpen) {
Unused << Send__delete__(this, aRv);
ClassifierInfo info;
info.list() = aList;
info.prefix() = aPrefix;
info.provider() = aProvider;
Unused << Send__delete__(this, info, aErrorCode);
}
return NS_OK;
}
@ -54,7 +62,7 @@ void
URLClassifierParent::ClassificationFailed()
{
if (mIPCOpen) {
Unused << Send__delete__(this, void_t());
Unused << Send__delete__(this, void_t(), NS_ERROR_FAILURE);
}
}

Просмотреть файл

@ -102,6 +102,7 @@ IPDL_SOURCES += [
'PScreenManager.ipdl',
'PTabContext.ipdlh',
'PURLClassifier.ipdl',
'PURLClassifierInfo.ipdlh',
'ServiceWorkerConfiguration.ipdlh',
]

Просмотреть файл

@ -263,6 +263,7 @@ TextTrack::SetReadyState(TextTrackReadyState aState)
if (mediaElement && (mReadyState == TextTrackReadyState::Loaded||
mReadyState == TextTrackReadyState::FailedToLoad)) {
mediaElement->RemoveTextTrack(this, true);
mediaElement->UpdateReadyState();
}
}
@ -337,5 +338,22 @@ TextTrack::DispatchAsyncTrustedEvent(const nsString& aEventName)
);
}
bool
TextTrack::IsLoaded()
{
if (mMode == TextTrackMode::Disabled) {
return true;
}
// If the TrackElement's src is null, we can not block the
// MediaElement.
if (mTrackElement) {
nsAutoString src;
if (!(mTrackElement->GetAttr(kNameSpaceID_None, nsGkAtoms::src, src))) {
return true;
}
}
return (mReadyState >= Loaded);
}
} // namespace dom
} // namespace mozilla

Просмотреть файл

@ -118,6 +118,8 @@ public:
void DispatchAsyncTrustedEvent(const nsString& aEventName);
bool IsLoaded();
private:
~TextTrack();

Просмотреть файл

@ -232,5 +232,17 @@ TextTrackList::SetCuesInactive()
}
}
bool TextTrackList::AreTextTracksLoaded()
{
// Return false if any texttrack is not loaded.
for (uint32_t i = 0; i < Length(); i++) {
if (!mTextTracks[i]->IsLoaded()) {
return false;
}
}
return true;
}
} // namespace dom
} // namespace mozilla

Просмотреть файл

@ -63,6 +63,8 @@ public:
void CreateAndDispatchChangeEvent();
void SetCuesInactive();
bool AreTextTracksLoaded();
IMPL_EVENT_HANDLER(change)
IMPL_EVENT_HANDLER(addtrack)
IMPL_EVENT_HANDLER(removetrack)

Просмотреть файл

@ -1358,6 +1358,9 @@ DrawTargetD2D1::FinalizeDrawing(CompositionOp aOp, const Pattern &aPattern)
// We don't need to preserve the current content of this layer as the output
// of the blend effect should completely replace it.
RefPtr<ID2D1Image> tmpImage = GetImageForLayerContent(false);
if (!tmpImage) {
return;
}
blendEffect->SetInput(0, tmpImage);
blendEffect->SetInput(1, source);
@ -1461,9 +1464,13 @@ DrawTargetD2D1::GetImageForLayerContent(bool aShouldPreserveContent)
HRESULT hr = mDC->CreateBitmap(D2DIntSize(mSize), D2D1::BitmapProperties(D2DPixelFormat(mFormat)), getter_AddRefs(tmpBitmap));
if (FAILED(hr)) {
gfxCriticalError(CriticalLog::DefaultOptions(Factory::ReasonableSurfaceSize(mSize))) << "[D2D1.1] 6CreateBitmap failure " << mSize << " Code: " << hexa(hr) << " format " << (int)mFormat;
// For now, crash in this scenario; this should happen because tmpBitmap is
// If it's a recreate target error, return and handle it elsewhere.
if (hr == D2DERR_RECREATE_TARGET) {
mDC->Flush();
return nullptr;
}
// For now, crash in other scenarios; this should happen because tmpBitmap is
// null and CopyFromBitmap call below dereferences it.
// return;
}
mDC->Flush();

Просмотреть файл

@ -609,7 +609,7 @@ nsFloatManager::FloatInfo::FloatInfo(nsIFrame* aFrame,
{
MOZ_COUNT_CTOR(nsFloatManager::FloatInfo);
const StyleShapeOutside& shapeOutside = mFrame->StyleDisplay()->mShapeOutside;
const StyleShapeSource& shapeOutside = mFrame->StyleDisplay()->mShapeOutside;
if (shapeOutside.GetType() == StyleShapeSourceType::None) {
return;
@ -764,7 +764,7 @@ nsFloatManager::FloatInfo::IsEmpty(ShapeType aShapeType) const
/* static */ LogicalRect
nsFloatManager::ShapeInfo::ComputeShapeBoxRect(
const StyleShapeOutside& aShapeOutside,
const StyleShapeSource& aShapeOutside,
nsIFrame* const aFrame,
const mozilla::LogicalRect& aMarginRect,
mozilla::WritingMode aWM)
@ -772,19 +772,20 @@ nsFloatManager::ShapeInfo::ComputeShapeBoxRect(
LogicalRect rect = aMarginRect;
switch (aShapeOutside.GetReferenceBox()) {
case StyleShapeOutsideShapeBox::Content:
case StyleGeometryBox::Content:
rect.Deflate(aWM, aFrame->GetLogicalUsedPadding(aWM));
MOZ_FALLTHROUGH;
case StyleShapeOutsideShapeBox::Padding:
case StyleGeometryBox::Padding:
rect.Deflate(aWM, aFrame->GetLogicalUsedBorder(aWM));
MOZ_FALLTHROUGH;
case StyleShapeOutsideShapeBox::Border:
case StyleGeometryBox::Border:
rect.Deflate(aWM, aFrame->GetLogicalUsedMargin(aWM));
break;
case StyleShapeOutsideShapeBox::Margin:
case StyleGeometryBox::Margin:
// Do nothing. rect is already a margin rect.
break;
case StyleShapeOutsideShapeBox::NoBox:
case StyleGeometryBox::NoBox:
default:
MOZ_ASSERT(aShapeOutside.GetType() != StyleShapeSourceType::Box,
"Box source type must have <shape-box> specified!");
break;

Просмотреть файл

@ -362,7 +362,7 @@ private:
virtual void Translate(nscoord aLineLeft, nscoord aBlockStart) = 0;
static mozilla::LogicalRect ComputeShapeBoxRect(
const mozilla::StyleShapeOutside& aShapeOutside,
const mozilla::StyleShapeSource& aShapeOutside,
nsIFrame* const aFrame,
const mozilla::LogicalRect& aMarginRect,
mozilla::WritingMode aWM);

Просмотреть файл

@ -1436,16 +1436,19 @@ bool
nsIFrame::GetShapeBoxBorderRadii(nscoord aRadii[8]) const
{
switch (StyleDisplay()->mShapeOutside.GetReferenceBox()) {
case StyleShapeOutsideShapeBox::NoBox:
case StyleGeometryBox::NoBox:
return false;
case StyleShapeOutsideShapeBox::Content:
case StyleGeometryBox::Content:
return GetContentBoxBorderRadii(aRadii);
case StyleShapeOutsideShapeBox::Padding:
case StyleGeometryBox::Padding:
return GetPaddingBoxBorderRadii(aRadii);
case StyleShapeOutsideShapeBox::Border:
case StyleGeometryBox::Border:
return GetBorderRadii(aRadii);
case StyleShapeOutsideShapeBox::Margin:
case StyleGeometryBox::Margin:
return GetMarginBoxBorderRadii(aRadii);
default:
MOZ_ASSERT_UNREACHABLE("Unexpected box value");
return false;
}
return false;
}

Просмотреть файл

@ -1019,7 +1019,7 @@ Gecko_SetStyleCoordCalcValue(nsStyleUnit* aUnit, nsStyleUnion* aValue, nsStyleCo
}
void
Gecko_CopyClipPathValueFrom(mozilla::StyleClipPath* aDst, const mozilla::StyleClipPath* aSrc)
Gecko_CopyClipPathValueFrom(mozilla::StyleShapeSource* aDst, const mozilla::StyleShapeSource* aSrc)
{
MOZ_ASSERT(aDst);
MOZ_ASSERT(aSrc);
@ -1028,13 +1028,13 @@ Gecko_CopyClipPathValueFrom(mozilla::StyleClipPath* aDst, const mozilla::StyleCl
}
void
Gecko_DestroyClipPath(mozilla::StyleClipPath* aClip)
Gecko_DestroyClipPath(mozilla::StyleShapeSource* aClip)
{
aClip->~StyleClipPath();
aClip->~StyleShapeSource();
}
void
Gecko_StyleClipPath_SetURLValue(mozilla::StyleClipPath* aClip, ServoBundledURI aURI)
Gecko_StyleClipPath_SetURLValue(mozilla::StyleShapeSource* aClip, ServoBundledURI aURI)
{
RefPtr<css::URLValue> url = aURI.IntoCssUrl();
aClip->SetURL(url.get());

Просмотреть файл

@ -285,11 +285,11 @@ void Gecko_ResetStyleCoord(nsStyleUnit* unit, nsStyleUnion* value);
// Set an nsStyleCoord to a computed `calc()` value
void Gecko_SetStyleCoordCalcValue(nsStyleUnit* unit, nsStyleUnion* value, nsStyleCoord::CalcValue calc);
void Gecko_CopyClipPathValueFrom(mozilla::StyleClipPath* dst, const mozilla::StyleClipPath* src);
void Gecko_CopyClipPathValueFrom(mozilla::StyleShapeSource* dst, const mozilla::StyleShapeSource* src);
void Gecko_DestroyClipPath(mozilla::StyleClipPath* clip);
void Gecko_DestroyClipPath(mozilla::StyleShapeSource* clip);
mozilla::StyleBasicShape* Gecko_NewBasicShape(mozilla::StyleBasicShapeType type);
void Gecko_StyleClipPath_SetURLValue(mozilla::StyleClipPath* clip, ServoBundledURI uri);
void Gecko_StyleClipPath_SetURLValue(mozilla::StyleShapeSource* clip, ServoBundledURI uri);
void Gecko_ResetFilters(nsStyleEffects* effects, size_t new_len);
void Gecko_CopyFiltersFrom(nsStyleEffects* aSrc, nsStyleEffects* aDest);

Просмотреть файл

@ -4102,7 +4102,7 @@ ExtractImageLayerSizePairList(const nsStyleImageLayers& aLayer,
}
static bool
StyleClipBasicShapeToCSSArray(const StyleClipPath& aClipPath,
StyleClipBasicShapeToCSSArray(const StyleShapeSource& aClipPath,
nsCSSValue::Array* aResult)
{
MOZ_ASSERT(aResult->Count() == 2,
@ -4474,7 +4474,7 @@ StyleAnimationValue::ExtractComputedValue(nsCSSPropertyID aProperty,
case eCSSProperty_clip_path: {
const nsStyleSVGReset* svgReset =
static_cast<const nsStyleSVGReset*>(styleStruct);
const StyleClipPath& clipPath = svgReset->mClipPath;
const StyleShapeSource& clipPath = svgReset->mClipPath;
const StyleShapeSourceType type = clipPath.GetType();
if (type == StyleShapeSourceType::URL) {

Просмотреть файл

@ -2342,10 +2342,10 @@ const KTableEntry nsCSSProps::kMaskTypeKTable[] = {
};
const KTableEntry nsCSSProps::kShapeOutsideShapeBoxKTable[] = {
{ eCSSKeyword_content_box, StyleShapeOutsideShapeBox::Content },
{ eCSSKeyword_padding_box, StyleShapeOutsideShapeBox::Padding },
{ eCSSKeyword_border_box, StyleShapeOutsideShapeBox::Border },
{ eCSSKeyword_margin_box, StyleShapeOutsideShapeBox::Margin },
{ eCSSKeyword_content_box, StyleGeometryBox::Content },
{ eCSSKeyword_padding_box, StyleGeometryBox::Padding },
{ eCSSKeyword_border_box, StyleGeometryBox::Border },
{ eCSSKeyword_margin_box, StyleGeometryBox::Margin },
{ eCSSKeyword_UNKNOWN, -1 }
};

Просмотреть файл

@ -6217,10 +6217,9 @@ nsComputedDOMStyle::CreatePrimitiveValueForShapeSource(
return valueList.forget();
}
template<typename ReferenceBox>
already_AddRefed<CSSValue>
nsComputedDOMStyle::GetShapeSource(
const StyleShapeSource<ReferenceBox>& aShapeSource,
const StyleShapeSource& aShapeSource,
const KTableEntry aBoxKeywordTable[])
{
switch (aShapeSource.GetType()) {

Просмотреть файл

@ -661,9 +661,8 @@ private:
already_AddRefed<CSSValue> CreatePrimitiveValueForStyleFilter(
const nsStyleFilter& aStyleFilter);
template<typename ReferenceBox>
already_AddRefed<CSSValue>
GetShapeSource(const mozilla::StyleShapeSource<ReferenceBox>& aShapeSource,
GetShapeSource(const mozilla::StyleShapeSource& aShapeSource,
const KTableEntry aBoxKeywordTable[]);
template<typename ReferenceBox>

Просмотреть файл

@ -141,9 +141,8 @@ CreateStyleImageRequest(nsPresContext* aPresContext, const nsCSSValue& aValue,
return request.forget();
}
template<typename ReferenceBox>
static void
SetStyleShapeSourceToCSSValue(StyleShapeSource<ReferenceBox>* aShapeSource,
SetStyleShapeSourceToCSSValue(StyleShapeSource* aShapeSource,
const nsCSSValue* aValue,
nsStyleContext* aStyleContext,
nsPresContext* aPresContext,
@ -6618,19 +6617,19 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct,
case eCSSUnit_None:
case eCSSUnit_Initial:
case eCSSUnit_Unset:
display->mShapeOutside = StyleShapeOutside();
display->mShapeOutside = StyleShapeSource();
break;
case eCSSUnit_Inherit:
conditions.SetUncacheable();
display->mShapeOutside = parentDisplay->mShapeOutside;
break;
case eCSSUnit_URL: {
display->mShapeOutside = StyleShapeOutside();
display->mShapeOutside = StyleShapeSource();
display->mShapeOutside.SetURL(shapeOutsideValue->GetURLStructValue());
break;
}
case eCSSUnit_Array: {
display->mShapeOutside = StyleShapeOutside();
display->mShapeOutside = StyleShapeSource();
SetStyleShapeSourceToCSSValue(&display->mShapeOutside, shapeOutsideValue,
aContext, mPresContext, conditions);
break;
@ -9841,10 +9840,9 @@ GetStyleBasicShapeFromCSSValue(const nsCSSValue& aValue,
return basicShape.forget();
}
template<typename ReferenceBox>
static void
SetStyleShapeSourceToCSSValue(
StyleShapeSource<ReferenceBox>* aShapeSource,
StyleShapeSource* aShapeSource,
const nsCSSValue* aValue,
nsStyleContext* aStyleContext,
nsPresContext* aPresContext,
@ -9857,13 +9855,13 @@ SetStyleShapeSourceToCSSValue(
MOZ_ASSERT(array->Count() == 1 || array->Count() == 2,
"Expect one or both of a shape function and a reference box");
ReferenceBox referenceBox = ReferenceBox::NoBox;
StyleGeometryBox referenceBox = StyleGeometryBox::NoBox;
RefPtr<StyleBasicShape> basicShape;
for (size_t i = 0; i < array->Count(); ++i) {
const nsCSSValue& item = array->Item(i);
if (item.GetUnit() == eCSSUnit_Enumerated) {
referenceBox = static_cast<ReferenceBox>(item.GetIntValue());
referenceBox = static_cast<StyleGeometryBox>(item.GetIntValue());
} else if (item.GetUnit() == eCSSUnit_Function) {
basicShape = GetStyleBasicShapeFromCSSValue(item, aStyleContext,
aPresContext, aConditions);
@ -9988,19 +9986,19 @@ nsRuleNode::ComputeSVGResetData(void* aStartStruct,
case eCSSUnit_None:
case eCSSUnit_Initial:
case eCSSUnit_Unset:
svgReset->mClipPath = StyleClipPath();
svgReset->mClipPath = StyleShapeSource();
break;
case eCSSUnit_Inherit:
conditions.SetUncacheable();
svgReset->mClipPath = parentSVGReset->mClipPath;
break;
case eCSSUnit_URL: {
svgReset->mClipPath = StyleClipPath();
svgReset->mClipPath = StyleShapeSource();
svgReset->mClipPath.SetURL(clipPathValue->GetURLStructValue());
break;
}
case eCSSUnit_Array: {
svgReset->mClipPath = StyleClipPath();
svgReset->mClipPath = StyleShapeSource();
SetStyleShapeSourceToCSSValue(&svgReset->mClipPath, clipPathValue, aContext,
mPresContext, conditions);
break;

Просмотреть файл

@ -84,8 +84,8 @@ enum class StyleClear : uint8_t {
Max = 13 // Max = (Both | Line)
};
// Define geometry box for clip-path's reference-box, background-clip,
// background-origin, mask-clip and mask-origin.
// Define geometry box for clip-path's reference-box, shape-outside's shape
// box, background-clip, background-origin, mask-clip and mask-origin.
enum class StyleGeometryBox : uint8_t {
Content,
Padding,
@ -144,15 +144,6 @@ enum class StyleHyphens : uint8_t {
Auto,
};
// shape-box for shape-outside
enum class StyleShapeOutsideShapeBox : uint8_t {
NoBox,
Content,
Padding,
Border,
Margin
};
// <shape-radius> for <basic-shape>
enum class StyleShapeRadius : uint8_t {
ClosestSide,

Просмотреть файл

@ -2640,7 +2640,6 @@ private:
nsStyleCorners mRadius;
};
template<typename ReferenceBox>
struct StyleShapeSource
{
StyleShapeSource()
@ -2678,7 +2677,7 @@ struct StyleShapeSource
SetReferenceBox(aOther.mReferenceBox);
} else {
ReleaseRef();
mReferenceBox = ReferenceBox::NoBox;
mReferenceBox = StyleGeometryBox::NoBox;
mType = StyleShapeSourceType::None;
}
return *this;
@ -2735,7 +2734,7 @@ struct StyleShapeSource
}
void SetBasicShape(StyleBasicShape* aBasicShape,
ReferenceBox aReferenceBox)
StyleGeometryBox aReferenceBox)
{
NS_ASSERTION(aBasicShape, "expected pointer");
ReleaseRef();
@ -2745,7 +2744,7 @@ struct StyleShapeSource
mType = StyleShapeSourceType::Shape;
}
ReferenceBox GetReferenceBox() const
StyleGeometryBox GetReferenceBox() const
{
MOZ_ASSERT(mType == StyleShapeSourceType::Box ||
mType == StyleShapeSourceType::Shape,
@ -2753,7 +2752,7 @@ struct StyleShapeSource
return mReferenceBox;
}
void SetReferenceBox(ReferenceBox aReferenceBox)
void SetReferenceBox(StyleGeometryBox aReferenceBox)
{
ReleaseRef();
mReferenceBox = aReferenceBox;
@ -2782,12 +2781,9 @@ private:
css::URLValue* mURL;
};
StyleShapeSourceType mType = StyleShapeSourceType::None;
ReferenceBox mReferenceBox = ReferenceBox::NoBox;
StyleGeometryBox mReferenceBox = StyleGeometryBox::NoBox;
};
using StyleClipPath = StyleShapeSource<StyleGeometryBox>;
using StyleShapeOutside = StyleShapeSource<StyleShapeOutsideShapeBox>;
} // namespace mozilla
struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleDisplay
@ -2910,7 +2906,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleDisplay
mAnimationPlayStateCount,
mAnimationIterationCountCount;
mozilla::StyleShapeOutside mShapeOutside; // [reset]
mozilla::StyleShapeSource mShapeOutside; // [reset]
bool IsBlockInsideStyle() const {
return mozilla::StyleDisplay::Block == mDisplay ||
@ -3890,7 +3886,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleSVGReset
}
nsStyleImageLayers mMask;
mozilla::StyleClipPath mClipPath; // [reset]
mozilla::StyleShapeSource mClipPath;// [reset]
nscolor mStopColor; // [reset]
nscolor mFloodColor; // [reset]
nscolor mLightingColor; // [reset]

Просмотреть файл

@ -142,7 +142,7 @@ Any line which doesn't follow the format above would be ignored like comment.
* test_namespace_rule.html [17]
* test_dont_use_document_colors.html: support of disabling document color [21]
* test_exposed_prop_accessors.html: mainly various unsupported properties [*]
* test_extra_inherit_initial.html: CSS-wide keywords are accepted as part of value servo/servo#15054 [946]
* test_extra_inherit_initial.html: CSS-wide keywords are accepted as part of value servo/servo#15054 [930]
* flex-basis glue not implemented bug 1331529
* test_flexbox_flex_shorthand.html `flex-basis` [28]
* test_flexbox_layout.html [355]
@ -436,8 +436,7 @@ Any line which doesn't follow the format above would be ignored like comment.
* {transform,perspective}-origin servo/servo#15487
* test_property_syntax_errors.html `transform-origin'` [50]
* ... `perspective-origin'` [30]
* test_property_syntax_errors.html `'border-spacing'`: servo/servo#15489 [7]
* ... `'text-overflow'`: servo/servo#15491 [8]
* test_property_syntax_errors.html `'text-overflow'`: servo/servo#15491 [8]
* Incorrect serialization
* border-radius and -moz-outline-radius shorthand servo/servo#15169
* test_priority_preservation.html `border-radius` [4]
@ -521,7 +520,7 @@ Any line which doesn't follow the format above would be ignored like comment.
* ... `: 10 ` [6]
* ... ` 2 ` [26]
* ... `: 5 ` [84]
* ... `border-spacing: ` [5]
* ... `border-spacing: ` [6]
* ... `rect(1, ` [1]
* test_pseudoelement_parsing.html: support parsing some pseudo-classes on some pseudo-elements [5]
* Unit should be preserved after parsing servo/servo#15346

Просмотреть файл

@ -28,7 +28,7 @@ public:
const gfxPoint& aPoint);
private:
explicit nsCSSClipPathInstance(nsIFrame* aFrame,
const StyleClipPath aClipPathStyle)
const StyleShapeSource aClipPathStyle)
: mTargetFrame(aFrame)
, mClipPathStyle(aClipPathStyle)
{
@ -53,7 +53,7 @@ private:
* The frame for the element that is currently being clipped.
*/
nsIFrame* mTargetFrame;
StyleClipPath mClipPathStyle;
StyleShapeSource mClipPathStyle;
};
} // namespace mozilla

Просмотреть файл

@ -249,6 +249,10 @@ RefPtr<NrSocketBase> TestNrSocket::create_external_socket(
}
int TestNrSocket::create(nr_transport_addr *addr) {
if (addr->tls_host[0] != '\0') {
tls_ = true;
}
return NrSocketBase::CreateSocket(addr, &internal_socket_);
}
@ -477,10 +481,6 @@ int TestNrSocket::connect(nr_transport_addr *addr) {
return R_INTERNAL;
}
if (addr->tls_host[0] != '\0') {
tls_ = true;
}
if (!nat_->enabled_
|| addr->protocol==IPPROTO_UDP // Horrible hack to allow default address
// discovery to work. Only works because

Просмотреть файл

@ -339,10 +339,10 @@ int nr_stun_server_process_request(nr_stun_server_ctx *ctx, nr_socket *sock, cha
_status=0;
abort:
if (NR_STUN_GET_TYPE_CLASS(req->header.type) == NR_CLASS_INDICATION)
if (!res)
goto skip_response;
if (!res)
if (NR_STUN_GET_TYPE_CLASS(req->header.type) == NR_CLASS_INDICATION)
goto skip_response;
/* Now respond */

Просмотреть файл

@ -72,6 +72,9 @@ public class BookmarksPanel extends HomeFragment {
// Callback for cursor loaders.
private CursorLoaderCallbacks mLoaderCallbacks;
// Keep track whether a fresh loader has been used or not.
private int mLastLoaderHash;
@Override
public void restoreData(@NonNull Bundle data) {
final ArrayList<FolderInfo> stack = data.getParcelableArrayList("parentStack");
@ -318,8 +321,13 @@ public class BookmarksPanel extends HomeFragment {
mPanelStateChangeListener.onStateChanged(bundle);
}
if (mList != null) {
// BrowserDB updates (e.g. through sync, or when opening a new tab) will trigger
// a refresh which reuses the same loader - in that case we don't want to reset
// the scroll position again.
int currentLoaderHash = bl.hashCode();
if (mList != null && currentLoaderHash != mLastLoaderHash) {
mList.setSelection(bl.getTargetPosition());
mLastLoaderHash = currentLoaderHash;
}
updateUiFromCursor(c);
}

Просмотреть файл

@ -3434,10 +3434,6 @@ function Tab(aURL, aParams) {
this.id = 0;
this._parentId = -1;
this.lastTouchedAt = Date.now();
this._zoom = 1.0;
this._drawZoom = 1.0;
this._restoreZoom = false;
this.userScrollPos = { x: 0, y: 0 };
this.contentDocumentIsDisplayed = true;
this.pluginDoorhangerTimeout = null;
this.shouldShowPluginDoorhanger = true;
@ -4513,66 +4509,37 @@ Tab.prototype = {
// notifications using nsBrowserStatusFilter.
},
_getGeckoZoom: function() {
let res = {};
let cwu = this.browser.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
cwu.getResolution(res);
let zoom = res.value * window.devicePixelRatio;
return zoom;
OnHistoryNewEntry: function(newURI, oldIndex) {
Services.obs.notifyObservers(this.browser, "Content:HistoryChange", null);
},
saveSessionZoom: function(aZoom) {
let cwu = this.browser.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
cwu.setResolutionAndScaleTo(aZoom / window.devicePixelRatio);
},
restoredSessionZoom: function() {
let cwu = this.browser.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
if (this._restoreZoom && cwu.isResolutionSet) {
return this._getGeckoZoom();
}
return null;
},
_updateZoomFromHistoryEvent: function(aHistoryEventName) {
// Restore zoom only when moving in session history, not for new page loads.
this._restoreZoom = aHistoryEventName !== "New";
},
OnHistoryNewEntry: function(aUri) {
this._updateZoomFromHistoryEvent("New");
},
OnHistoryGoBack: function(aUri) {
this._updateZoomFromHistoryEvent("Back");
OnHistoryGoBack: function(backURI) {
Services.obs.notifyObservers(this.browser, "Content:HistoryChange", null);
return true;
},
OnHistoryGoForward: function(aUri) {
this._updateZoomFromHistoryEvent("Forward");
OnHistoryGoForward: function(forwardURI) {
Services.obs.notifyObservers(this.browser, "Content:HistoryChange", null);
return true;
},
OnHistoryReload: function(aUri, aFlags) {
// we don't do anything with this, so don't propagate it
// for now anyway
OnHistoryReload: function(reloadURI, reloadFlags) {
Services.obs.notifyObservers(this.browser, "Content:HistoryChange", null);
return true;
},
OnHistoryGotoIndex: function(aIndex, aUri) {
this._updateZoomFromHistoryEvent("Goto");
OnHistoryGotoIndex: function(index, gotoURI) {
Services.obs.notifyObservers(this.browser, "Content:HistoryChange", null);
return true;
},
OnHistoryPurge: function(aNumEntries) {
this._updateZoomFromHistoryEvent("Purge");
OnHistoryPurge: function(numEntries) {
Services.obs.notifyObservers(this.browser, "Content:HistoryChange", null);
return true;
},
OnHistoryReplaceEntry: function(aIndex) {
// we don't do anything with this, so don't propogate it
// for now anyway.
OnHistoryReplaceEntry: function(index) {
Services.obs.notifyObservers(this.browser, "Content:HistoryChange", null);
},
ShouldNotifyMediaPlaybackChange: function(inactive) {
@ -4654,10 +4621,6 @@ Tab.prototype = {
return this.browser.contentWindow;
},
get scale() {
return this._zoom;
},
QueryInterface: XPCOMUtils.generateQI([
Ci.nsIWebProgressListener,
Ci.nsISHistoryListener,

Просмотреть файл

@ -183,6 +183,7 @@ SessionStore.prototype = {
observerService.addObserver(this, "quit-application", true);
observerService.addObserver(this, "Session:Restore", true);
observerService.addObserver(this, "Session:NotifyLocationChange", true);
observerService.addObserver(this, "Content:HistoryChange", true);
observerService.addObserver(this, "Tab:KeepZombified", true);
observerService.addObserver(this, "application-background", true);
observerService.addObserver(this, "application-foreground", true);
@ -313,6 +314,27 @@ SessionStore.prototype = {
}
break;
}
case "Content:HistoryChange": {
let browser = aSubject;
let window = browser.ownerGlobal;
log("Content:HistoryChange for tab " + window.BrowserApp.getTabForBrowser(browser).id);
// We want to ignore history changes which we caused ourselves when
// restoring the history of a delay-loaded tab.
if (!browser.__SS_restore && !browser.__SS_restoreReloadPending) {
// The OnHistory... notifications are called *before* the history changes
// are persisted. We therefore need to make our onTabLoad call async,
// so it can actually capture the new session history state.
if (browser.__SS_historyChange) {
window.clearTimeout(browser.__SS_historyChange);
}
browser.__SS_historyChange =
window.setTimeout(() => {
delete browser.__SS_historyChange;
this.onTabLoad(window, browser);
}, 0);
}
break;
}
case "Tabs:OpenMultiple": {
let data = JSON.parse(aData);
@ -619,6 +641,11 @@ SessionStore.prototype = {
aBrowser.removeEventListener("scroll", this, true);
aBrowser.removeEventListener("resize", this, true);
if (aBrowser.__SS_historyChange) {
aWindow.clearTimeout(aBrowser.__SS_historyChange);
delete aBrowser.__SS_historyChange;
}
delete aBrowser.__SS_data;
log("onTabRemove() ran for tab " + aWindow.BrowserApp.getTabForBrowser(aBrowser).id +
@ -1639,12 +1666,12 @@ SessionStore.prototype = {
tab.browser.__SS_extdata = tabData.extData;
if (window.BrowserApp.selectedTab == tab) {
this._restoreTab(tabData, tab.browser);
// We can now lift the general ban on tab data capturing,
// but we still need to protect the foreground tab until we're
// After we're done restoring, we can lift the general ban on tab data
// capturing, but we still need to protect the foreground tab until we're
// sure it's actually reloading after history restoring has finished.
tab.browser.__SS_restoreReloadPending = true;
this._restoreTab(tabData, tab.browser);
this._startupRestoreFinished = true;
log("startupRestoreFinished = true");

Просмотреть файл

@ -225,7 +225,11 @@ add_task(function* test_formdata_navigation() {
// Go back.
is(browser.canGoBack, true, "can go back");
browser.goBack();
yield promiseTabEvent(browser, "SSTabDataUpdated");
let titleChange = promiseTabEvent(browser, "DOMTitleChanged");
let tabDataUpdate = promiseTabEvent(browser, "SSTabDataUpdated");
yield titleChange;
yield tabDataUpdate;
is(browser.currentURI.spec, URL, "navigated back to form data page");
// Make sure form data is still present.

Просмотреть файл

@ -2237,9 +2237,9 @@ pref("extensions.blocklist.interval", 86400);
// Required blocklist freshness for OneCRL OCSP bypass
// (default is 1.25x extensions.blocklist.interval, or 30 hours)
pref("security.onecrl.maximum_staleness_in_seconds", 108000);
pref("extensions.blocklist.url", "https://blocklist.addons.mozilla.org/blocklist/3/%APP_ID%/%APP_VERSION%/%PRODUCT%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/%PING_COUNT%/%TOTAL_PING_COUNT%/%DAYS_SINCE_LAST_PING%/");
pref("extensions.blocklist.detailsURL", "https://www.mozilla.com/%LOCALE%/blocklist/");
pref("extensions.blocklist.itemURL", "https://blocklist.addons.mozilla.org/%LOCALE%/%APP%/blocked/%blockID%");
pref("extensions.blocklist.url", "https://blocklists.settings.services.mozilla.com/v1/blocklist/3/%APP_ID%/%APP_VERSION%/%PRODUCT%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/%PING_COUNT%/%TOTAL_PING_COUNT%/%DAYS_SINCE_LAST_PING%/");
pref("extensions.blocklist.detailsURL", "https://blocked.cdn.mozilla.net/");
pref("extensions.blocklist.itemURL", "https://blocked.cdn.mozilla.net/%blockID%.html");
// Controls what level the blocklist switches from warning about items to forcibly
// blocking them.
pref("extensions.blocklist.level", 2);
@ -5189,6 +5189,9 @@ pref("browser.safebrowsing.provider.google.lists", "goog-badbinurl-shavar,goog-d
pref("browser.safebrowsing.provider.google.updateURL", "https://safebrowsing.google.com/safebrowsing/downloads?client=SAFEBROWSING_ID&appver=%MAJOR_VERSION%&pver=2.2&key=%GOOGLE_API_KEY%");
pref("browser.safebrowsing.provider.google.gethashURL", "https://safebrowsing.google.com/safebrowsing/gethash?client=SAFEBROWSING_ID&appver=%MAJOR_VERSION%&pver=2.2");
pref("browser.safebrowsing.provider.google.reportURL", "https://safebrowsing.google.com/safebrowsing/diagnostic?client=%NAME%&hl=%LOCALE%&site=");
pref("browser.safebrowsing.provider.google.reportPhishMistakeURL", "https://%LOCALE%.phish-error.mozilla.com/?hl=%LOCALE%&url=");
pref("browser.safebrowsing.provider.google.reportMalwareMistakeURL", "https://%LOCALE%.malware-error.mozilla.com/?hl=%LOCALE%&url=");
// Prefs for v4.
pref("browser.safebrowsing.provider.google4.pver", "4");
@ -5197,10 +5200,10 @@ pref("browser.safebrowsing.provider.google4.updateURL", "https://safebrowsing.go
// Leave it empty until we roll out v4 hash completion feature. See Bug 1323856.
pref("browser.safebrowsing.provider.google4.gethashURL", "");
pref("browser.safebrowsing.provider.google4.reportURL", "https://safebrowsing.google.com/safebrowsing/diagnostic?client=%NAME%&hl=%LOCALE%&site=");
pref("browser.safebrowsing.provider.google4.reportPhishMistakeURL", "https://%LOCALE%.phish-error.mozilla.com/?hl=%LOCALE%&url=");
pref("browser.safebrowsing.provider.google4.reportMalwareMistakeURL", "https://%LOCALE%.malware-error.mozilla.com/?hl=%LOCALE%&url=");
pref("browser.safebrowsing.reportPhishMistakeURL", "https://%LOCALE%.phish-error.mozilla.com/?hl=%LOCALE%&url=");
pref("browser.safebrowsing.reportPhishURL", "https://%LOCALE%.phish-report.mozilla.com/?hl=%LOCALE%&url=");
pref("browser.safebrowsing.reportMalwareMistakeURL", "https://%LOCALE%.malware-error.mozilla.com/?hl=%LOCALE%&url=");
// The table and global pref for blocking plugin content
pref("browser.safebrowsing.blockedURIs.enabled", true);

Просмотреть файл

@ -32,6 +32,7 @@ XPIDL_SOURCES += [
'nsIChannelEventSink.idl',
'nsIChannelWithDivertableParentListener.idl',
'nsIChildChannel.idl',
'nsIClassifiedChannel.idl',
'nsIClassOfService.idl',
'nsIContentSniffer.idl',
'nsICryptoFIPSInfo.idl',

Просмотреть файл

@ -311,7 +311,8 @@ nsChannelClassifier::Start()
if (NS_FAILED(rv)) {
// If we aren't getting a callback for any reason, assume a good verdict and
// make sure we resume the channel if necessary.
OnClassifyComplete(NS_OK);
OnClassifyComplete(NS_OK, NS_LITERAL_CSTRING(""),NS_LITERAL_CSTRING(""),
NS_LITERAL_CSTRING(""));
}
}
@ -577,19 +578,33 @@ nsChannelClassifier::SameLoadingURI(nsIDocument *aDoc, nsIChannel *aChannel)
// static
nsresult
nsChannelClassifier::SetBlockedTrackingContent(nsIChannel *channel)
nsChannelClassifier::SetBlockedContent(nsIChannel *channel,
nsresult aErrorCode,
const nsACString& aList,
const nsACString& aProvider,
const nsACString& aPrefix)
{
NS_ENSURE_ARG(!aList.IsEmpty());
NS_ENSURE_ARG(!aPrefix.IsEmpty());
// Can be called in EITHER the parent or child process.
nsCOMPtr<nsIParentChannel> parentChannel;
NS_QueryNotificationCallbacks(channel, parentChannel);
if (parentChannel) {
// This channel is a parent-process proxy for a child process request. The
// actual channel will be notified via the status passed to
// nsIRequest::Cancel and do this for us.
// This channel is a parent-process proxy for a child process request.
// Tell the child process channel to do this instead.
parentChannel->SetClassifierMatchedInfo(aList, aProvider, aPrefix);
return NS_OK;
}
nsresult rv;
nsCOMPtr<nsIClassifiedChannel> classifiedChannel = do_QueryInterface(channel, &rv);
NS_ENSURE_SUCCESS(rv, rv);
if (classifiedChannel) {
classifiedChannel->SetMatchedInfo(aList, aProvider, aPrefix);
}
nsCOMPtr<mozIDOMWindowProxy> win;
nsCOMPtr<mozIThirdPartyUtil> thirdPartyUtil =
do_GetService(THIRDPARTYUTIL_CONTRACTID, &rv);
@ -622,9 +637,14 @@ nsChannelClassifier::SetBlockedTrackingContent(nsIChannel *channel)
if (!securityUI) {
return NS_OK;
}
doc->SetHasTrackingContentBlocked(true);
securityUI->GetState(&state);
state |= nsIWebProgressListener::STATE_BLOCKED_TRACKING_CONTENT;
if (aErrorCode == NS_ERROR_TRACKING_URI) {
doc->SetHasTrackingContentBlocked(true);
state |= nsIWebProgressListener::STATE_BLOCKED_TRACKING_CONTENT;
} else {
state |= nsIWebProgressListener::STATE_BLOCKED_UNSAFE_CONTENT;
}
eventSink->OnSecurityChange(nullptr, state);
// Log a warning to the web console.
@ -632,11 +652,17 @@ nsChannelClassifier::SetBlockedTrackingContent(nsIChannel *channel)
channel->GetURI(getter_AddRefs(uri));
NS_ConvertUTF8toUTF16 spec(uri->GetSpecOrDefault());
const char16_t* params[] = { spec.get() };
const char* message = (aErrorCode == NS_ERROR_TRACKING_URI) ?
"TrackingUriBlocked" : "UnsafeUriBlocked";
nsCString category = (aErrorCode == NS_ERROR_TRACKING_URI) ?
NS_LITERAL_CSTRING("Tracking Protection") :
NS_LITERAL_CSTRING("Safe Browsing");
nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
NS_LITERAL_CSTRING("Tracking Protection"),
category,
doc,
nsContentUtils::eNECKO_PROPERTIES,
"TrackingUriBlocked",
message,
params, ArrayLength(params));
return NS_OK;
@ -707,7 +733,10 @@ nsChannelClassifier::IsTrackerWhitelisted()
}
NS_IMETHODIMP
nsChannelClassifier::OnClassifyComplete(nsresult aErrorCode)
nsChannelClassifier::OnClassifyComplete(nsresult aErrorCode,
const nsACString& aList,
const nsACString& aProvider,
const nsACString& aPrefix)
{
// Should only be called in the parent process.
MOZ_ASSERT(XRE_IsParentProcess());
@ -774,12 +803,11 @@ nsChannelClassifier::OnClassifyComplete(nsresult aErrorCode)
uri->GetSpecOrDefault().get(), errorName.get()));
}
// Channel will be cancelled (page element blocked) due to tracking.
// Channel will be cancelled (page element blocked) due to tracking
// protection or Safe Browsing.
// Do update the security state of the document and fire a security
// change event.
if (aErrorCode == NS_ERROR_TRACKING_URI) {
SetBlockedTrackingContent(mChannel);
}
SetBlockedContent(mChannel, aErrorCode, aList, aProvider, aPrefix);
mChannel->Cancel(aErrorCode);
}

Просмотреть файл

@ -61,9 +61,13 @@ private:
bool AddonMayLoad(nsIChannel *aChannel, nsIURI *aUri);
public:
// If we are blocking tracking content, update the corresponding flag in
// the respective docshell and call nsISecurityEventSink::onSecurityChange.
static nsresult SetBlockedTrackingContent(nsIChannel *channel);
// If we are blocking content, update the corresponding flag in the respective
// docshell and call nsISecurityEventSink::onSecurityChange.
static nsresult SetBlockedContent(nsIChannel *channel,
nsresult aErrorCode,
const nsACString& aList,
const nsACString& aProvider,
const nsACString& aPrefix);
static nsresult NotifyTrackingProtectionDisabled(nsIChannel *aChannel);
};

Просмотреть файл

@ -0,0 +1,47 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsISupports.idl"
/**
* nsIClassifiedChannel
*
* A channel may optionally implement this interface if it carries classified
* result information of channel classifier. The information contains, for
* example, the name of matched table and the name of matched provider.
*/
[scriptable, uuid(70cf6091-a1de-4aa8-8224-058f8964be31)]
interface nsIClassifiedChannel : nsISupports
{
/**
* Sets matched info of the classified channel.
*
* @param aList
* Name of the Safe Browsing list that matched (e.g. goog-phish-shavar).
* @param aProvider
* Name of the Safe Browsing provider that matched (e.g. google)
* @param aPrefix
* Hash prefix of URL that matched Safe Browsing list.
*/
void setMatchedInfo(in ACString aList,
in ACString aProvider,
in ACString aPrefix);
/**
* Name of the list that matched
*/
readonly attribute ACString matchedList;
/**
* Name of provider that matched
*/
readonly attribute ACString matchedProvider;
/**
* Hash prefix of URL that matched
*/
readonly attribute ACString matchedPrefix;
};

Просмотреть файл

@ -34,6 +34,19 @@ interface nsIParentChannel : nsIStreamListener
*/
[noscript] void notifyTrackingProtectionDisabled();
/**
* Called to set matched information when URL matches SafeBrowsing list.
* @param aList
* Name of the list that matched
* @param aProvider
* Name of provider that matched
* @param aPrefix
* String represents hash prefix that matched
*/
[noscript] void setClassifierMatchedInfo(in ACString aList,
in ACString aProvider,
in ACString aPrefix);
/**
* Called to notify the HttpChannelChild that the resource being loaded
* is on the tracking protection list.

Просмотреть файл

@ -29,8 +29,17 @@ interface nsIURIClassifierCallback : nsISupports
* @param aErrorCode
* The error code with which the channel should be cancelled, or
* NS_OK if the load should continue normally.
* @param aList
* Name of the list that matched
* @param aProvider
* Name of provider that matched
* @param aPrefix
* Hash prefix of URL that matched
*/
void onClassifyComplete(in nsresult aErrorCode);
void onClassifyComplete(in nsresult aErrorCode,
in ACString aList,
in ACString aProvider,
in ACString aPrefix);
};
/**

Просмотреть файл

@ -39,6 +39,7 @@ SuperfluousAuth=You are about to log in to the site “%1$S” with the username
AutomaticAuth=You are about to log in to the site “%1$S” with the username “%2$S”.
TrackingUriBlocked=The resource at “%1$S” was blocked because tracking protection is enabled.
UnsafeUriBlocked=The resource at “%1$S” was blocked by Safe Browsing.
# LOCALIZATION NOTE (APIDeprecationWarning):
# %1$S is the deprecated API; %2$S is the API function that should be used.

Просмотреть файл

@ -49,6 +49,15 @@ DataChannelParent::NotifyTrackingResource()
return NS_OK;
}
NS_IMETHODIMP
DataChannelParent::SetClassifierMatchedInfo(const nsACString& aList,
const nsACString& aProvider,
const nsACString& aPrefix)
{
// nothing to do
return NS_OK;
}
NS_IMETHODIMP
DataChannelParent::Delete()
{

Просмотреть файл

@ -570,6 +570,15 @@ FTPChannelParent::NotifyTrackingResource()
return NS_OK;
}
NS_IMETHODIMP
FTPChannelParent::SetClassifierMatchedInfo(const nsACString& aList,
const nsACString& aProvider,
const nsACString& aPrefix)
{
// One day, this should probably be filled in.
return NS_OK;
}
NS_IMETHODIMP
FTPChannelParent::Delete()
{

Просмотреть файл

@ -345,6 +345,7 @@ NS_INTERFACE_MAP_BEGIN(HttpBaseChannel)
NS_INTERFACE_MAP_ENTRY(nsITimedChannel)
NS_INTERFACE_MAP_ENTRY(nsIConsoleReportCollector)
NS_INTERFACE_MAP_ENTRY(nsIThrottledInputChannel)
NS_INTERFACE_MAP_ENTRY(nsIClassifiedChannel)
if (aIID.Equals(NS_GET_IID(HttpBaseChannel))) {
foundInterface = static_cast<nsIWritablePropertyBag*>(this);
} else
@ -3382,6 +3383,41 @@ HttpBaseChannel::SameOriginWithOriginalUri(nsIURI *aURI)
}
//-----------------------------------------------------------------------------
// HttpBaseChannel::nsIClassifiedChannel
NS_IMETHODIMP
HttpBaseChannel::GetMatchedList(nsACString& aList)
{
aList = mMatchedList;
return NS_OK;
}
NS_IMETHODIMP
HttpBaseChannel::GetMatchedProvider(nsACString& aProvider)
{
aProvider = mMatchedProvider;
return NS_OK;
}
NS_IMETHODIMP
HttpBaseChannel::GetMatchedPrefix(nsACString& aPrefix)
{
aPrefix = mMatchedPrefix;
return NS_OK;
}
NS_IMETHODIMP
HttpBaseChannel::SetMatchedInfo(const nsACString& aList,
const nsACString& aProvider,
const nsACString& aPrefix) {
NS_ENSURE_ARG(!aList.IsEmpty());
mMatchedList = aList;
mMatchedProvider = aProvider;
mMatchedPrefix = aPrefix;
return NS_OK;
}
//-----------------------------------------------------------------------------
// HttpBaseChannel::nsITimedChannel

Просмотреть файл

@ -29,6 +29,7 @@
#include "nsIStringEnumerator.h"
#include "nsISupportsPriority.h"
#include "nsIClassOfService.h"
#include "nsIClassifiedChannel.h"
#include "nsIApplicationCache.h"
#include "nsIResumableChannel.h"
#include "nsITraceableChannel.h"
@ -90,6 +91,7 @@ class HttpBaseChannel : public nsHashPropertyBag
, public nsIForcePendingChannel
, public nsIConsoleReportCollector
, public nsIThrottledInputChannel
, public nsIClassifiedChannel
{
protected:
virtual ~HttpBaseChannel();
@ -102,6 +104,7 @@ public:
NS_DECL_NSITRACEABLECHANNEL
NS_DECL_NSITIMEDCHANNEL
NS_DECL_NSITHROTTLEDINPUTCHANNEL
NS_DECL_NSICLASSIFIEDCHANNEL
NS_DECLARE_STATIC_IID_ACCESSOR(HTTP_BASE_CHANNEL_IID)
@ -600,6 +603,11 @@ protected:
nsID mChannelId;
nsString mIntegrityMetadata;
// Classified channel's matched information
nsCString mMatchedList;
nsCString mMatchedProvider;
nsCString mMatchedPrefix;
};
NS_DEFINE_STATIC_IID_ACCESSOR(HttpBaseChannel, HTTP_BASE_CHANNEL_IID)

Просмотреть файл

@ -969,8 +969,23 @@ HttpChannelChild::DoOnStopRequest(nsIRequest* aRequest, nsresult aChannelStatus,
// NB: We use aChannelStatus here instead of mStatus because if there was an
// nsCORSListenerProxy on this request, it will override the tracking
// protection's return value.
if (aChannelStatus == NS_ERROR_TRACKING_URI) {
nsChannelClassifier::SetBlockedTrackingContent(this);
if (aChannelStatus == NS_ERROR_TRACKING_URI ||
aChannelStatus == NS_ERROR_MALWARE_URI ||
aChannelStatus == NS_ERROR_UNWANTED_URI ||
aChannelStatus == NS_ERROR_BLOCKED_URI ||
aChannelStatus == NS_ERROR_PHISHING_URI) {
nsCString list, provider, prefix;
nsresult rv = GetMatchedList(list);
NS_ENSURE_SUCCESS_VOID(rv);
rv = GetMatchedProvider(provider);
NS_ENSURE_SUCCESS_VOID(rv);
rv = GetMatchedPrefix(prefix);
NS_ENSURE_SUCCESS_VOID(rv);
nsChannelClassifier::SetBlockedContent(this, aChannelStatus, list, provider, prefix);
}
MOZ_ASSERT(!mOnStopRequestCalled,
@ -1517,6 +1532,14 @@ HttpChannelChild::FlushedForDiversion()
SendDivertComplete();
}
mozilla::ipc::IPCResult
HttpChannelChild::RecvSetClassifierMatchedInfo(const ClassifierInfo& aInfo)
{
SetMatchedInfo(aInfo.list(), aInfo.provider(), aInfo.prefix());
return IPC_OK();
}
mozilla::ipc::IPCResult
HttpChannelChild::RecvDivertMessages()
{

Просмотреть файл

@ -108,6 +108,7 @@ public:
mozilla::ipc::IPCResult RecvNotifyTrackingProtectionDisabled() override;
mozilla::ipc::IPCResult RecvNotifyTrackingResource() override;
void FlushedForDiversion();
mozilla::ipc::IPCResult RecvSetClassifierMatchedInfo(const ClassifierInfo& aInfo) override;
protected:
mozilla::ipc::IPCResult RecvOnStartRequest(const nsresult& channelStatus,

Просмотреть файл

@ -41,6 +41,7 @@
#include "nsIDocument.h"
#include "nsStringStream.h"
#include "nsQueryObject.h"
#include "nsIURIClassifier.h"
using mozilla::BasePrincipal;
using namespace mozilla::dom;
@ -1363,6 +1364,22 @@ HttpChannelParent::NotifyTrackingProtectionDisabled()
return NS_OK;
}
NS_IMETHODIMP
HttpChannelParent::SetClassifierMatchedInfo(const nsACString& aList,
const nsACString& aProvider,
const nsACString& aPrefix)
{
if (!mIPCClosed) {
ClassifierInfo info;
info.list() = aList;
info.prefix() = aPrefix;
info.provider() = aProvider;
Unused << SendSetClassifierMatchedInfo(info);
}
return NS_OK;
}
NS_IMETHODIMP
HttpChannelParent::NotifyTrackingResource()
{

Просмотреть файл

@ -10,6 +10,7 @@ include InputStreamParams;
include URIParams;
include PBackgroundSharedTypes;
include NeckoChannelParams;
include PURLClassifierInfo;
include protocol PBlob; //FIXME: bug #792908
@ -168,6 +169,9 @@ child:
// Tell the child to issue a deprecation warning.
async IssueDeprecationWarning(uint32_t warning, bool asError);
// Tell the child information of matched URL againts SafeBrowsing list
async SetClassifierMatchedInfo(ClassifierInfo info);
both:
// After receiving this message, the parent also calls
// SendFinishInterceptedRedirect, and makes sure not to send any more messages

Просмотреть файл

@ -162,29 +162,10 @@ nsParserUtils::ParseFragment(const nsAString& aFragment,
// the fragment.
nsresult rv = NS_OK;
AutoTArray<nsString, 2> tagStack;
nsAutoCString base, spec;
if (aIsXML) {
// XHTML
if (aBaseURI) {
base.AppendLiteral(XHTML_DIV_TAG);
base.AppendLiteral(" xml:base=\"");
rv = aBaseURI->GetSpec(spec);
NS_ENSURE_SUCCESS(rv, rv);
// nsEscapeHTML is good enough, because we only need to get
// quotes, ampersands, and angle brackets
char* escapedSpec = nsEscapeHTML(spec.get());
if (escapedSpec)
base += escapedSpec;
free(escapedSpec);
base.Append('"');
tagStack.AppendElement(NS_ConvertUTF8toUTF16(base));
} else {
tagStack.AppendElement(NS_LITERAL_STRING(XHTML_DIV_TAG));
}
}
nsCOMPtr<nsIContent> fragment;
if (aIsXML) {
// XHTML
tagStack.AppendElement(NS_LITERAL_STRING(XHTML_DIV_TAG));
rv = nsContentUtils::ParseFragmentXML(aFragment,
document,
tagStack,
@ -200,24 +181,6 @@ nsParserUtils::ParseFragment(const nsAString& aFragment,
kNameSpaceID_XHTML,
false,
true);
// Now, set the base URI on all subtree roots.
if (aBaseURI) {
nsresult rv2 = aBaseURI->GetSpec(spec);
NS_ENSURE_SUCCESS(rv2, rv2);
nsAutoString spec16;
CopyUTF8toUTF16(spec, spec16);
nsIContent* node = fragment->GetFirstChild();
while (node) {
if (node->IsElement()) {
node->SetAttr(kNameSpaceID_XML,
nsGkAtoms::base,
nsGkAtoms::xml,
spec16,
false);
}
node = node->GetNextSibling();
}
}
}
if (fragment) {
nsTreeSanitizer sanitizer(aFlags);

63
servo/Cargo.lock сгенерированный
Просмотреть файл

@ -282,7 +282,6 @@ dependencies = [
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)",
"offscreen_gl_context 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"plugins 0.0.1",
"servo_config 0.0.1",
"webrender_traits 0.16.0 (git+https://github.com/servo/webrender)",
]
@ -296,7 +295,6 @@ dependencies = [
"heapsize 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize_derive 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"plugins 0.0.1",
"serde 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)",
"webrender_traits 0.16.0 (git+https://github.com/servo/webrender)",
@ -360,19 +358,6 @@ dependencies = [
"vec_map 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "clippy_lints"
version = "0.0.112"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"quine-mc_cluskey 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"regex-syntax 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"semver 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"toml 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-normalization 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "cmake"
version = "0.1.20"
@ -426,7 +411,6 @@ dependencies = [
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
"net_traits 0.0.1",
"plugins 0.0.1",
"profile_traits 0.0.1",
"script_traits 0.0.1",
"servo_config 0.0.1",
@ -459,7 +443,6 @@ dependencies = [
"msg 0.0.1",
"net_traits 0.0.1",
"offscreen_gl_context 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"plugins 0.0.1",
"profile_traits 0.0.1",
"script_traits 0.0.1",
"serde 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)",
@ -623,7 +606,6 @@ dependencies = [
"ipc-channel 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
"plugins 0.0.1",
"serde 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)",
@ -685,7 +667,6 @@ dependencies = [
"msg 0.0.1",
"net_traits 0.0.1",
"objc 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"plugins 0.0.1",
"script_traits 0.0.1",
"servo_config 0.0.1",
"servo_geometry 0.0.1",
@ -962,7 +943,6 @@ dependencies = [
"msg 0.0.1",
"net_traits 0.0.1",
"ordered-float 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"plugins 0.0.1",
"range 0.0.1",
"serde 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)",
@ -997,7 +977,6 @@ version = "0.0.1"
dependencies = [
"heapsize 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize_derive 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"plugins 0.0.1",
"range 0.0.1",
"serde 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1281,7 +1260,7 @@ dependencies = [
[[package]]
name = "js"
version = "0.1.4"
source = "git+https://github.com/servo/rust-mozjs#93e59ef1263e451143d0ed431f1aa564ea101ab8"
source = "git+https://github.com/servo/rust-mozjs#101c6b6b58e0b7c5ed1ef2b6b676a7497f90df2f"
dependencies = [
"cmake 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1342,7 +1321,6 @@ dependencies = [
"net_traits 0.0.1",
"ordered-float 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"parking_lot 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"plugins 0.0.1",
"profile_traits 0.0.1",
"range 0.0.1",
"rayon 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1388,7 +1366,6 @@ dependencies = [
"msg 0.0.1",
"net_traits 0.0.1",
"parking_lot 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"plugins 0.0.1",
"profile_traits 0.0.1",
"rayon 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"script 0.0.1",
@ -1489,7 +1466,6 @@ dependencies = [
"msg 0.0.1",
"net 0.0.1",
"net_traits 0.0.1",
"plugins 0.0.1",
"profile 0.0.1",
"profile_traits 0.0.1",
"script 0.0.1",
@ -1647,7 +1623,6 @@ dependencies = [
"cssparser 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize_derive 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"plugins 0.0.1",
"serde 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)",
"webrender_traits 0.16.0 (git+https://github.com/servo/webrender)",
@ -1675,7 +1650,6 @@ dependencies = [
"net_traits 0.0.1",
"openssl 0.7.14 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-verify 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"plugins 0.0.1",
"profile_traits 0.0.1",
"rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)",
"servo_config 0.0.1",
@ -1716,7 +1690,6 @@ dependencies = [
"msg 0.0.1",
"net 0.0.1",
"net_traits 0.0.1",
"plugins 0.0.1",
"profile_traits 0.0.1",
"servo_config 0.0.1",
"servo_url 0.0.1",
@ -2016,13 +1989,6 @@ dependencies = [
"script_plugins 0.0.1",
]
[[package]]
name = "plugins"
version = "0.0.1"
dependencies = [
"clippy_lints 0.0.112 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "pnacl-build-helper"
version = "1.4.10"
@ -2050,7 +2016,6 @@ dependencies = [
"ipc-channel 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"plugins 0.0.1",
"profile_traits 0.0.1",
"regex 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2078,7 +2043,6 @@ dependencies = [
"energymon 0.3.0 (git+https://github.com/energymon/energymon-rust.git)",
"ipc-channel 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"plugins 0.0.1",
"serde 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)",
"servo_config 0.0.1",
@ -2106,11 +2070,6 @@ dependencies = [
"syntex_syntax 0.54.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "quine-mc_cluskey"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "quote"
version = "0.3.12"
@ -2268,7 +2227,6 @@ dependencies = [
"phf 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)",
"phf_codegen 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)",
"phf_shared 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)",
"plugins 0.0.1",
"profile_traits 0.0.1",
"range 0.0.1",
"ref_filter_map 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2318,7 +2276,6 @@ dependencies = [
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
"net_traits 0.0.1",
"plugins 0.0.1",
"profile_traits 0.0.1",
"range 0.0.1",
"script_traits 0.0.1",
@ -2337,7 +2294,6 @@ version = "0.0.1"
dependencies = [
"euclid 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
"plugins 0.0.1",
"script 0.0.1",
"servo_url 0.0.1",
]
@ -2362,7 +2318,6 @@ dependencies = [
"msg 0.0.1",
"net_traits 0.0.1",
"offscreen_gl_context 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"plugins 0.0.1",
"profile_traits 0.0.1",
"rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2389,14 +2344,6 @@ name = "semver"
version = "0.1.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "semver"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"nom 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "serde"
version = "0.9.7"
@ -2589,7 +2536,6 @@ dependencies = [
"lazy_static 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"plugins 0.0.1",
"rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)",
@ -3027,9 +2973,6 @@ dependencies = [
name = "toml"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "traitobject"
@ -3196,7 +3139,6 @@ dependencies = [
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
"net_traits 0.0.1",
"plugins 0.0.1",
"regex 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)",
"script_traits 0.0.1",
@ -3404,7 +3346,6 @@ dependencies = [
"checksum cgl 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "8bdd78cca65a739cb5475dbf6b6bbb49373e327f4a6f2b499c0f98632df38c10"
"checksum clang-sys 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4f98f0715ff67f27ca6a2f8f0ffc2a56f8edbc7acd57489c29eadc3a15c4eafe"
"checksum clap 2.20.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a60af5cb867dd4ee2378398acde80c73b466b58a963f598061ce7e394800998d"
"checksum clippy_lints 0.0.112 (registry+https://github.com/rust-lang/crates.io-index)" = "51461bf5f0862158b3239e55af263d5fe67620ccbb824f87c9ed0f7cd1ce1184"
"checksum cmake 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)" = "a3a6805df695087e7c1bcd9a82e03ad6fb864c8e67ac41b1348229ce5b7f0407"
"checksum cocoa 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d55b620aff4da7d4b9d85f2974cc62a097146623b75e3f36734fe68d8cef493e"
"checksum color_quant 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a475fc4af42d83d28adf72968d9bcfaf035a1a9381642d8e85d8a04957767b0d"
@ -3536,7 +3477,6 @@ dependencies = [
"checksum png 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3cb773e9a557edb568ce9935cf783e3cdcabe06a9449d41b3e5506d88e582c82"
"checksum quasi 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dcbf815446dc6a0afbc72d88f9a8aa71b608d10b168e09437c80c0fd6fd410c9"
"checksum quasi_codegen 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b06172e92ab0099427609854ffb1512c377be5fc4beaf572ae5d5a01b8359596"
"checksum quine-mc_cluskey 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "07589615d719a60c8dd8a4622e7946465dfef20d1a428f969e3443e7386d5f45"
"checksum quote 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)" = "e7b44fd83db28b83c1c58187159934906e5e955c812e211df413b76b03c909a5"
"checksum rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "022e0636ec2519ddae48154b028864bdce4eaf7d35226ab8e65c611be97b189d"
"checksum rayon 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "50c575b58c2b109e2fbc181820cbe177474f35610ff9e357dc75f6bac854ffbf"
@ -3552,7 +3492,6 @@ dependencies = [
"checksum same-file 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d931a44fdaa43b8637009e7632a02adc4f2b2e0733c08caa4cf00e8da4a117a7"
"checksum scoped_threadpool 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "3ef399c8893e8cb7aa9696e895427fab3a6bf265977bb96e126f24ddd2cda85a"
"checksum semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)" = "d4f410fedcf71af0345d7607d246e7ad15faaadd49d240ee3b24e5dc21a820ac"
"checksum semver 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2d5b7638a1f03815d94e88cb3b3c08e87f0db4d683ef499d1836aaf70a45623f"
"checksum serde 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1e0ed773960f90a78567fcfbe935284adf50c5d7cf119aa2cf43bb0b4afa69bb"
"checksum serde_codegen 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1f94de585a73dfc312ca77194209278a587bf90d3edc6c2d0fc479b0ed71d1f0"
"checksum serde_codegen_internals 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "afad7924a009f859f380e4a2e3a509a845c2ac66435fcead74a4d983b21ae806"

Просмотреть файл

@ -19,7 +19,6 @@ ipc-channel = "0.7"
log = "0.3.5"
num-traits = "0.1.32"
offscreen_gl_context = "0.6"
plugins = {path = "../plugins"}
servo_config = {path = "../config"}
[dependencies.webrender_traits]

Просмотреть файл

@ -2,9 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#![feature(plugin)]
#![plugin(plugins)]
#![deny(unsafe_code)]
extern crate azure;

Просмотреть файл

@ -15,7 +15,6 @@ euclid = "0.11"
heapsize = "0.3.0"
heapsize_derive = "0.1"
ipc-channel = "0.7"
plugins = {path = "../plugins"}
serde = {version = "0.9", features = ["unstable"]}
serde_derive = "0.9"

Просмотреть файл

@ -4,8 +4,6 @@
#![crate_name = "canvas_traits"]
#![crate_type = "rlib"]
#![feature(plugin)]
#![plugin(plugins)]
#![deny(unsafe_code)]

Просмотреть файл

@ -18,7 +18,6 @@ ipc-channel = "0.7"
log = "0.3.5"
msg = {path = "../msg"}
net_traits = {path = "../net_traits"}
plugins = {path = "../plugins"}
profile_traits = {path = "../profile_traits"}
script_traits = {path = "../script_traits"}
servo_config = {path = "../config", features = ["servo"]}

Просмотреть файл

@ -2,11 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#![feature(box_syntax)]
#![feature(plugin)]
#![plugin(plugins)]
#![deny(unsafe_code)]
#![feature(box_syntax)]
extern crate euclid;
extern crate gfx_traits;

Просмотреть файл

@ -11,7 +11,7 @@ path = "lib.rs"
[features]
# servo as opposed to geckolib
servo = ["plugins", "serde", "serde_derive", "servo_url/servo"]
servo = ["serde", "serde_derive", "servo_url/servo"]
[dependencies]
euclid = "0.11"
@ -19,7 +19,6 @@ getopts = "0.2.11"
lazy_static = "0.2"
log = "0.3.5"
num_cpus = "1.1.0"
plugins = {path = "../plugins", optional = true}
rustc-serialize = "0.3"
serde = {version = "0.9", optional = true}
serde_derive = {version = "0.9", optional = true}

Просмотреть файл

@ -2,9 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#![cfg_attr(feature = "servo", feature(plugin))]
#![cfg_attr(feature = "servo", plugin(plugins))]
#![deny(unsafe_code)]
extern crate euclid;

Просмотреть файл

@ -26,7 +26,6 @@ log = "0.3.5"
msg = {path = "../msg"}
net_traits = {path = "../net_traits"}
offscreen_gl_context = "0.6"
plugins = {path = "../plugins"}
profile_traits = {path = "../profile_traits"}
script_traits = {path = "../script_traits"}
serde = "0.9"

Просмотреть файл

@ -2,13 +2,10 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#![deny(unsafe_code)]
#![feature(box_syntax)]
#![feature(conservative_impl_trait)]
#![feature(mpsc_select)]
#![feature(plugin)]
#![plugin(plugins)]
#![deny(unsafe_code)]
extern crate backtrace;
extern crate bluetooth_traits;

Просмотреть файл

@ -17,7 +17,6 @@ hyper_serde = "0.5"
ipc-channel = "0.7"
log = "0.3.5"
msg = {path = "../msg"}
plugins = {path = "../plugins"}
serde = "0.9"
serde_derive = "0.9"
serde_json = "0.9"

Просмотреть файл

@ -10,12 +10,9 @@
#![crate_name = "devtools"]
#![crate_type = "rlib"]
#![feature(box_syntax)]
#![feature(plugin)]
#![plugin(plugins)]
#![allow(non_snake_case)]
#![deny(unsafe_code)]
#![feature(box_syntax)]
extern crate devtools_traits;
extern crate encoding;

Просмотреть файл

@ -27,7 +27,6 @@ log = "0.3.5"
msg = {path = "../msg"}
net_traits = {path = "../net_traits"}
ordered-float = "0.4"
plugins = {path = "../plugins"}
range = {path = "../range"}
serde = "0.9"
serde_derive = "0.9"

Просмотреть файл

@ -8,12 +8,9 @@
#![cfg_attr(any(target_os = "linux", target_os = "android"), feature(alloc))]
#![feature(box_syntax)]
#![feature(plugin)]
#![feature(range_contains)]
#![feature(unique)]
#![plugin(plugins)]
#![deny(unsafe_code)]
#[cfg(any(target_os = "linux", target_os = "android"))]

Просмотреть файл

@ -12,7 +12,6 @@ path = "lib.rs"
[dependencies]
heapsize = "0.3.0"
heapsize_derive = "0.1"
plugins = {path = "../plugins"}
range = {path = "../range"}
serde = "0.9"
serde_derive = "0.9"

Просмотреть файл

@ -2,9 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#![feature(plugin)]
#![plugin(plugins)]
#![crate_name = "gfx_traits"]
#![crate_type = "rlib"]

Просмотреть файл

@ -7,7 +7,6 @@ extern crate proc_macro;
extern crate syn;
extern crate synstructure;
#[cfg(not(test))]
#[proc_macro_derive(JSTraceable)]
pub fn expand_token_stream(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
expand_string(&input.to_string()).parse().unwrap()

Просмотреть файл

@ -28,7 +28,6 @@ msg = {path = "../msg"}
net_traits = {path = "../net_traits"}
ordered-float = "0.4"
parking_lot = "0.3.3"
plugins = {path = "../plugins"}
profile_traits = {path = "../profile_traits"}
range = {path = "../range"}
rayon = "0.6"

Просмотреть файл

@ -2,18 +2,14 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#![deny(unsafe_code)]
#![feature(box_patterns)]
#![feature(box_syntax)]
#![feature(conservative_impl_trait)]
#![feature(nonzero)]
#![feature(plugin)]
#![feature(raw)]
#![feature(step_by)]
#![deny(unsafe_code)]
#![plugin(plugins)]
extern crate app_units;
extern crate atomic_refcell;
#[macro_use]

Просмотреть файл

@ -24,7 +24,6 @@ log = "0.3.5"
msg = {path = "../msg"}
net_traits = {path = "../net_traits"}
parking_lot = {version = "0.3.3", features = ["nightly"]}
plugins = {path = "../plugins"}
profile_traits = {path = "../profile_traits"}
rayon = "0.6"
script = {path = "../script"}

Просмотреть файл

@ -7,9 +7,6 @@
#![feature(box_syntax)]
#![feature(mpsc_select)]
#![feature(plugin)]
#![plugin(plugins)]
extern crate app_units;
extern crate euclid;

Просмотреть файл

@ -14,7 +14,6 @@ bitflags = "0.7"
cssparser = {version = "0.10", features = ["heapsize", "serde"]}
heapsize = "0.3.0"
heapsize_derive = "0.1"
plugins = {path = "../plugins"}
serde = "0.9"
serde_derive = "0.9"

Просмотреть файл

@ -2,9 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#![feature(plugin)]
#![plugin(plugins)]
#![deny(unsafe_code)]
#[macro_use]

Просмотреть файл

@ -28,7 +28,6 @@ msg = {path = "../msg"}
net_traits = {path = "../net_traits"}
openssl = "0.7.6"
openssl-verify = "0.1"
plugins = {path = "../plugins"}
profile_traits = {path = "../profile_traits"}
rustc-serialize = "0.3"
servo_config = {path = "../config"}

Просмотреть файл

@ -2,12 +2,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#![deny(unsafe_code)]
#![feature(box_syntax)]
#![feature(mpsc_select)]
#![feature(plugin)]
#![plugin(plugins)]
#![deny(unsafe_code)]
extern crate brotli;
extern crate content_blocker as content_blocker_parser;

Просмотреть файл

@ -1,18 +0,0 @@
[package]
name = "plugins"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
publish = false
[lib]
name = "plugins"
path = "lib.rs"
plugin = true
[dependencies.clippy_lints]
version = "0.0.112"
optional = true
[features]
clippy = ["clippy_lints"]

Просмотреть файл

@ -1,22 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
//! Exists only to hook into clippy.
#![cfg_attr(feature = "clippy", feature(plugin, plugin_registrar, rustc_private))]
#![deny(unsafe_code)]
#[cfg(feature = "clippy")]
extern crate clippy_lints;
#[cfg(feature = "clippy")]
extern crate rustc_plugin;
#[cfg(feature = "clippy")]
use rustc_plugin::Registry;
#[cfg(feature = "clippy")]
#[plugin_registrar]
pub fn plugin_registrar(reg: &mut Registry) {
::clippy_lints::register_plugins(reg);
}

Просмотреть файл

@ -11,7 +11,6 @@ path = "lib.rs"
[dependencies]
profile_traits = {path = "../profile_traits"}
plugins = {path = "../plugins"}
ipc-channel = "0.7"
heartbeats-simple = "0.4"
log = "0.3.5"

Просмотреть файл

@ -4,8 +4,6 @@
#![cfg_attr(not(target_os = "windows"), feature(alloc_jemalloc))]
#![feature(box_syntax)]
#![feature(plugin)]
#![plugin(plugins)]
#![deny(unsafe_code)]

Просмотреть файл

@ -17,7 +17,6 @@ energy-monitor = {version = "0.2.0", optional = true}
energymon = {git = "https://github.com/energymon/energymon-rust.git", optional = true}
ipc-channel = "0.7"
log = "0.3.5"
plugins = {path = "../plugins"}
serde = "0.9"
serde_derive = "0.9"
servo_config = {path = "../config"}

Просмотреть файл

@ -6,11 +6,8 @@
//! rest of Servo. These APIs are here instead of in `profile` so that these
//! modules won't have to depend on `profile`.
#![feature(box_syntax)]
#![feature(plugin)]
#![plugin(plugins)]
#![deny(unsafe_code)]
#![feature(box_syntax)]
extern crate ipc_channel;
#[macro_use]

Просмотреть файл

@ -63,7 +63,6 @@ offscreen_gl_context = "0.6"
open = "1.1.1"
parking_lot = "0.3"
phf = "0.7.18"
plugins = {path = "../plugins"}
profile_traits = {path = "../profile_traits"}
range = {path = "../range"}
ref_filter_map = "1.0.1"

Просмотреть файл

@ -967,14 +967,11 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
handleInvalidEnumValueCode = "return true;"
template = (
"match find_enum_string_index(cx, ${val}, %(values)s) {\n"
"match find_enum_value(cx, ${val}, %(pairs)s) {\n"
" Err(_) => { %(exceptionCode)s },\n"
" Ok((None, search)) => { %(handleInvalidEnumValueCode)s },\n"
" Ok((Some(index), _)) => {\n"
" //XXXjdm need some range checks up in here.\n"
" mem::transmute(index)\n"
" },\n"
"}" % {"values": enum + "Values::strings",
" Ok((Some(&value), _)) => value,\n"
"}" % {"pairs": enum + "Values::pairs",
"exceptionCode": exceptionCode,
"handleInvalidEnumValueCode": handleInvalidEnumValueCode})
@ -3978,39 +3975,41 @@ class CGEnum(CGThing):
def __init__(self, enum):
CGThing.__init__(self)
ident = enum.identifier.name
decl = """\
#[repr(usize)]
#[derive(JSTraceable, PartialEq, Copy, Clone, HeapSizeOf, Debug)]
pub enum %s {
%s
}
""" % (enum.identifier.name, ",\n ".join(map(getEnumValueName, enum.values())))
""" % (ident, ",\n ".join(map(getEnumValueName, enum.values())))
pairs = ",\n ".join(['("%s", super::%s::%s)' % (val, ident, getEnumValueName(val)) for val in enum.values()])
inner = """\
use dom::bindings::conversions::ToJSValConvertible;
use js::jsapi::{JSContext, MutableHandleValue};
use js::jsval::JSVal;
pub const strings: &'static [&'static str] = &[
pub const pairs: &'static [(&'static str, super::%s)] = &[
%s,
];
impl super::%s {
pub fn as_str(&self) -> &'static str {
strings[*self as usize]
pairs[*self as usize].0
}
}
impl ToJSValConvertible for super::%s {
unsafe fn to_jsval(&self, cx: *mut JSContext, rval: MutableHandleValue) {
strings[*self as usize].to_jsval(cx, rval);
pairs[*self as usize].0.to_jsval(cx, rval);
}
}
""" % (",\n ".join(['"%s"' % val for val in enum.values()]), enum.identifier.name, enum.identifier.name)
""" % (ident, pairs, ident, ident)
self.cgRoot = CGList([
CGGeneric(decl),
CGNamespace.build([enum.identifier.name + "Values"],
CGNamespace.build([ident + "Values"],
CGIndenter(CGGeneric(inner)), public=True),
])
@ -5573,7 +5572,7 @@ def generate_imports(config, cgthings, descriptors, callbacks=None, dictionaries
'dom::bindings::utils::ProtoOrIfaceArray',
'dom::bindings::utils::enumerate_global',
'dom::bindings::utils::finalize_global',
'dom::bindings::utils::find_enum_string_index',
'dom::bindings::utils::find_enum_value',
'dom::bindings::utils::generic_getter',
'dom::bindings::utils::generic_lenient_getter',
'dom::bindings::utils::generic_lenient_setter',

Просмотреть файл

@ -177,20 +177,20 @@ pub fn get_array_index_from_id(_cx: *mut JSContext, id: HandleId) -> Option<u32>
}*/
}
/// Find the index of a string given by `v` in `values`.
/// Find the enum equivelent of a string given by `v` in `pairs`.
/// Returns `Err(())` on JSAPI failure (there is a pending exception), and
/// `Ok((None, value))` if there was no matching string.
pub unsafe fn find_enum_string_index(cx: *mut JSContext,
pub unsafe fn find_enum_value<'a, T>(cx: *mut JSContext,
v: HandleValue,
values: &[&'static str])
-> Result<(Option<usize>, DOMString), ()> {
pairs: &'a [(&'static str, T)])
-> Result<(Option<&'a T>, DOMString), ()> {
let jsstr = ToString(cx, v);
if jsstr.is_null() {
return Err(());
}
let search = jsstring_to_str(cx, jsstr);
Ok((values.iter().position(|value| search == *value), search))
Ok((pairs.iter().find(|&&(key, _)| search == *key).map(|&(_, ref ev)| ev), search))
}
/// Returns wether `obj` is a platform object

Просмотреть файл

@ -11,7 +11,7 @@ use dom::bindings::js::Root;
use dom::bindings::reflector::{Reflector, reflect_dom_object};
use dom::globalscope::GlobalScope;
use js::jsapi::{JSContext, JSObject};
use js::jsapi::{JS_GetArrayBufferViewType, Type};
use js::jsapi::Type;
use servo_rand::{ServoRng, Rng};
unsafe_no_jsmanaged_fields!(ServoRng);
@ -46,15 +46,15 @@ impl CryptoMethods for Crypto {
-> Fallible<NonZero<*mut JSObject>> {
assert!(!input.is_null());
typedarray!(in(_cx) let mut array_buffer_view: ArrayBufferView = input);
let mut data = match array_buffer_view.as_mut() {
Ok(x) => x.as_mut_slice(),
let (array_type, mut data) = match array_buffer_view.as_mut() {
Ok(x) => (x.get_array_type(), x.as_mut_slice()),
Err(_) => {
return Err(Error::Type("Argument to Crypto.getRandomValues is not an ArrayBufferView"
.to_owned()));
}
};
if !is_integer_buffer(input) {
if !is_integer_buffer(array_type) {
return Err(Error::TypeMismatch);
}
@ -68,9 +68,8 @@ impl CryptoMethods for Crypto {
}
}
#[allow(unsafe_code)]
fn is_integer_buffer(input: *mut JSObject) -> bool {
match unsafe { JS_GetArrayBufferViewType(input) } {
fn is_integer_buffer(array_type: Type) -> bool {
match array_type {
Type::Uint8 |
Type::Uint8Clamped |
Type::Int8 |

Просмотреть файл

@ -37,7 +37,7 @@ use dom::window::Window;
use euclid::size::Size2D;
use ipc_channel::ipc::{self, IpcSender};
use js::conversions::ConversionBehavior;
use js::jsapi::{JSContext, JSObject, JS_GetArrayBufferViewType, Type, Rooted};
use js::jsapi::{JSContext, JSObject, Type, Rooted};
use js::jsval::{BooleanValue, DoubleValue, Int32Value, JSVal, NullValue, UndefinedValue};
use js::typedarray::{TypedArray, TypedArrayElement, Float32, Int32};
use net_traits::image::base::PixelFormat;
@ -2080,8 +2080,8 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
}
typedarray!(in(cx) let mut pixels_data: ArrayBufferView = pixels);
let mut data = match { pixels_data.as_mut() } {
Ok(data) => data.as_mut_slice(),
let (array_type, mut data) = match { pixels_data.as_mut() } {
Ok(data) => (data.get_array_type(), data.as_mut_slice()),
Err(_) => return Err(Error::Type("Not an ArrayBufferView".to_owned())),
};
@ -2089,7 +2089,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
return Ok(());
}
match { JS_GetArrayBufferViewType(pixels) } {
match array_type {
Type::Uint8 => (),
_ => return Ok(self.webgl_error(InvalidOperation)),
}

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше