mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-26 05:37:11 +00:00
import changes from `dev' branch of rmottola/Arctic-Fox:
- Bug 1252882 - Content-Signature Service - some tests r=keeler,r=fkiefer (7fc1f726a4)
- Bug 1265085 - Replace verification source with a SAN in the content signature verifier interface. r=Cykesiopka,r=fkiefer (0881ba797d)
- Bug 1242820 - Disable devtools/shared/security/tests/unit/test_oob_crt_auth.js and test_encryption.js on emulator-x86-kk; r=jryans (746802bb0e)
- Bug 1264706: Move nsILocalCertService, and implementation, to security/manager/ssl in order to alloow use w use elsewhere in gecko. r=dkeeler (6f2200f2a6)
- Bug 1219088 - Clear the session cache when a weak crypto override is revoked. r=keeler (456e2ce3e6)
- Bug 550185 - Ensure nsCertTree::GetCellText returns an initialized value. r=kaie (ee356452a5)
- Bug 1252384 - Remove nsICertTree.isHostPortOverride(). r=dkeele It is unused since the changes in Bug 825583 landed. (61400adad7)
- reorder as Bug 1411458 (600fc338a9)
- bug 1264761 - improve handling of x509 versions in certificate manager r=Cykesiopka (a89237c66d)
- Bug 1263857 - (followup) Disable windows crash reporter on automated tests. r=sfink (bb9581fec9)
- bug 1263221 - improve how PSM handles the visibility of __CERT_AddTempCertToPerm r=chmanchester,mgoodwin (d9fd09d9a6)
- bug 1182742 - allow users to override small key size errors r=rbarnes (b09074987b)
- Bug 1252722 - Fully implement nsNSSShutDownObject everywhere. r=keeler (8c1a8df597)
- Bug 1252722 - Use smart pointers for NSS resources. r=keeler (b2ef34f9d2)
- Bug 1252722 - Ensure arguments of all public methods are checked. r=keeler (7064697e25)
- bug 1242032 - change some pipnss logging output from Debug to Verbose r=Cykesiopka (516c52da9f)
- Bug 1252722 - Improve handling of PK11_* function error codes. r=keeler (b47d13bd7e)
- Bug 1251801 - Ensure arguments of all public methods are checked. r=keeler (ffe77174e7)
- Bug 1127158 - Remove brittle debug only flag math in nsSecureBrowserUIImpl.cpp. r=dkeeler (410d25dc3e)
- Bug 1257246: Update security/manager for eslint 2. r=cykesiopka (bbdcf78264)
- bug 1218515 - flip pinning-test.badssl.com into production mode r=jcj DONTBUILD NPOTB (0d93e78cab)
- Bug 1199624 - Don't use memset and memcmp in files that don't include cstring explicitly. r=briansmith (5a938e056c)
- Bug 1154399 - Part 1: De-templatize and un-inline IntegralValue. r=keeler (bcaa11a646)
- Bug 1154399 - Part 2: Simplify and un-inline OptionalVersion. r=keeler (a5a9bb5e46)
- Bug 1154399 - Part 3: Simplify OptionalExtensions. r=keeler (0d3f613cde)
- Bug 1154399 - Part 4: Simplify certificate parsing in OCSP responses. r=keeler (94aa90a96d)
- Bug 1189020 - Replace |// unnamed namespace| with |// namespace| in mozilla::pkix. r=Cykesiopka (bb016e13ac)
- bug 1255153 - (re)move redundant xpcshell name constraint tests to gtests r=Cykesiopka,jcj (d8597a3bb1)
- bug 1248099 - add extended key usage tests for mozilla::pkix r=Cykesiopka,jcj (f9c11a8ecc)
- Bug 1266298 - Add sys_fchmod to seccomp whitelist r=jld (e16608d738)
- Bug 1268579 - Add inotify_rm_watch to the seccomp-bpf whitelist. r=jld (c20823e237)
- Bug 1176099 - Add hooks for sigprocmask/pthread_sigmask. r=jld r=glandium (55d16a8e41)
- Bug 1176099 - Fix missing NULL check r=luke (2f6e6e3836)
- Bug 1245789 - Use ifdef MOZ_WIDEVINE_EME to prevent compilation when not enabled. r=gerald (40d13ca2d9)
- Bug 1267453 - Amazon Widevine rejects HDCP on MacBook Pro with or without an external display. r=gcp (5366006c54)
- Bug 1268379 - Delay WMF checks in GMPParent - r=jesup (0f6642fdcc)
- bit of Bug 1245789 - Push detection of WMF decoding (e60b0634de)
- missing bit of 1267453 (573b867a62)
- Bug 1243594 (part 3) - leave the utf-8 encoding of the payload to rest.js instead of directly in loop. r=Standard8 (7781df1275)
- Bug 1243594 (part 2) - have rest.js automatically encode the request body as utf-8. r=gfritzsche (fd98dddf43)
- Bug 1246938 - Allow extra headers to be passed via hawk requests. r=markh (3692244524)
- Bug 1239354: Replace old-style generator function with star functions. r=asuth (a7793a89aa)
- Bug 1217982 - Remove for-each from storage/. r=mak (bbff0f0b7b)
- Bug 1095739 - Allow a "new user" experience to happen subsequent to Firefox being uninstalled. r=gijs r=jimm (2d846f8338)
- Bug 1251819 - Use the classic Control Panel if the Settings app believes the current Windows logon is a Microsoft account while actually it is not. r=jimm (e93f2cac88)
- Bug 1258728 - keep remote newtab version in a pref r=ursula (6f9bacf2ac)
- Bug 1223510, part 1 - Always finishTest() in test_nonUnicode.html. r=baku (ba3fb681ad)
- Bug 1223510, part 2 - Make ArchiveReader tests use pushPrefEnv. r=baku (5a4a5f9a7a)
- Bug 1223510, part 3 - Change where generator is created. r=baku Mostly this lets us take advantage of things created during the initial setup. (ee337d83de)
- Bug 1220304 - Part 1 - Make test_XHRSendData.html use SpecialPowers.createFiles(). r=baku (91fc25f3b7)
- Bug 1220304 - Part 2 - Make ArchiveReader tests use SpecialPowers.createFiles(). r=baku (5a0bfc4200)
- Bug 1267966 - Remove the deprecation warning from Attr.ownerElement; r=baku (cfd8910f2f)
- Bug 1269646 - Console API should be NOP after window-inner-destroyed, r=smaug (c4e5959d1f)
- Bug 1263392 - ConsoleCallData::mStatus should be set also when ConsoleCallData is not used in workers, r=smaug (10358e33a1)
- Bug 1268361 - Strip leading '?' in new URLSearchParams(query), r=smaug (a1a5075185)
- Bug 1052139 - Make more objects on the global prototype chain have immutable [[Prototype]], when we enable enforcement of this requirement. r=bz (8e48cfc3d6)
- Bug 1267932 - Update EventSource.webidl, r=ehsan (41532a54d5)
- Bug 1269383 - Remove dom.server-events.enabled pref, r=smaug (21e65b8436)
- Bug 1237077 - Part 1: drag an URL into new tab should inherit userContextId. r=Gijs, tanvi (f27d38ef25)
- Bug 1237077 - Part 3: use createCodebasePrincipal. r=tanvi (7da7268d47)
- Bug 1264270 - Parser should output attributes in source order, not reversed; r=hsivonen,bgrins (2f78eda012)
- Bug 1268721, part 1 - Use early continue in TransferableToIPCTransferable. r=jimm (317ab04f38)
- Bug 1268721, part 2 - Null check first argument to nsContentUtils::GetSurfaceData(). r=jimm (544d181021)
- Bug 1272203 (part 3) - Use NotNull in nsContentUtils::GetSurfaceData(). r=froydnj. (65e488c4f8)
- Bug 1272203 (part 1) - Add mozilla::NotNull to MFBT. r=froydnj. (4653d120fc)
- Bug 964092: don't let DOM DataChannels get GC'd if they have an active callback r=smaug,jib (c9c291f44a)
- Bug 1224186: Implement DOMTokenlist.replace r=baku,Ms2ger (329f4f942e)
- Bug 1265715 - Part 1. Pull Mode out of nsDisplayListBuilder; r=jfkthame (2c7cae0f3a)
- Bug 1265715 - Part 2. Add nsDisplayListBuilderMode parameter into nsLayoutUtils::PaintFrame; r=jfkthame (5ecabbda5d)
- Bug 1264949 - Ensure that the display list does not contain any background-image/background-color display item; r=jfkthame (018a7aec15)
- Bug 1265715 - Part 3. Use nsLayoutUtils::PaintFrame in ClipBackgroundByText; r=jfkthame (182a700fa6)
- Bug 1265715 - Part 4. Fix transform problem; r=jfkthame (37f77bf24b)
- Bug 1265715 - Part 5. bg-clip:text transform reftest; r=jfkthame (44778bcfd7)
- Bug 1267209 - Convert nsLayoutUtils::PaintFrame flags to be an enum class. r=jfkthame (4f304b84f1)
- Bug 1267530 part 1 - Add some profiler marker for fullscreen transition. r=smaug,BenWa (3580b0a556)
- Bug 1267530 part 2 - Add ASCII art explaination of flow of fullscreen transition. r=smaug (6bee4c9db6)
- Bug 1265280 - Temporary debugging code to crash with a useful abort message. r=khuey (43d532166f)
- Bug 1232939 - Ensure the opaque region of a fixed background layer is correctly clipped. r=mstange (cc2118e0a0)
- Bug 735857 - Treat background-attachment:fixed as background-attachment:scroll if it's on a non-root element affected by a transform. r=mstange (273d62aabf)
- Bug 735857 - Factor out a helper function nsLayoutUtils::IsTransformed(). r=mstange (61528fafef)
- Bug 1263286 - Move base-uri CSP check into SetBaseURIUsingFirstBaseWithHref. r=bz (03114b2fcb)
- Bug 1227327 - Allow specifying a background rect for background dislay items. r=mattwoodrow (410ef269eb)
- Bug 1227327 - Make fieldset frames build nsDisplayBackgroundImage items. r=mattwoodrow (9a3a8953b4)
- Fix temporary debugging patch for bug 1265280 so we'll hit the condition. r=khuey (fd30f8f0b4)
- Bug 1265715 - followup - Correct dirty region; r=me (38fc76e698)
- Bug 550426 - Use background-position-x/y in ActiveLayerTracker. r=dbaron (4f154a39dd)
- Bug 1266131 part 1 - [css-grid] 'order' doesn't apply to grid-aligned abs.pos. descendants (anymore). r=dholbert (ba8aa18fea)
- Bug 1266131 part 2 - [css-grid] Remove unused nsDisplayList::SortByCSSOrder() function. r=dholbert (b676c48a26)
- Bug 550426 - Add support for {background,mask}-position-{x,y}, most of the style system changes. r=dbaron (3739a8ec58)
- Bug 550426 - Add support for {background,mask}-position-{x,y}, StyleAnimation changes. r=dbaron (0fd2f97a60)
- Bug 852754 - Part 4: Reduce max downscaling allowed to <3. r=mstange (399b851221)
- Bug 1266868, part 1 - Fix nsCSSValue::Array leaks in the StyleAnimationValue code. r=dholbert (c6fc4f7d9c)
- Bug 1266868, part 2 - Fix leaks of the values passed to nsCSSValue::.SetPairValue in the StyleAnimationValue code. r=dholbert (e5a1ff8603)
- Bug 1266868, part 3 - Avoid Maybe::ref() where not necessary. r=dholbert (8dd435fd5e)
- Back out bug 1164227, because bug 1236043 fixes the original problem in a better way. (6b734f0718)
- Bug 1267524 Part 1 - Use member initializer list for nsStyleOutline. r=heycam (d7cabb2ea8)
- Bug 1267524 Part 2 - Use member initializer list for nsStyleXUL. r=heycam (82107506a6)
- Bug 1267524 Part 3 - Use member initializer list for nsStyleColumn. r=heycam (80318b0056)
- Bug 1267524 Part 4.1 - Add Reset() and rewrite methods for nsStyleSVGPaint. r=heycam (02ba8762cb)
- Bug 1267524 Part 4.2 - Use member initializer list for nsStyleSVG. r=heycam (5531ed4a93)
- Bug 1267524 Part 5 - Use member initializer list for nsStyleSVGReset. r=heycam (4a72005b1b)
- Bug 1267524 Part 6 - Use member initializer list for nsStylePosition. r=heycam (cfd6a8b640)
- Bug 1267524 Part 7 - Use member initializer list for nsStyleTable. r=heycam (510678ed8b)
- Bug 1267524 Part 8 - Use member initializer list for nsStyleTableBorder. r=heycam (c1617af193)
- Bug 1267524 Part 9 - Use member initializer list for nsStyleColor. r=heycam (753afba9f8)
- Bug 1267524 Part 10 - Use member initializer list for nsStyleDisplay. r=heycam (a6cc7ce52b)
- Bug 1267524 Part 11 - Use member initializer list for nsStyleVisibility. r=heycam (c93d75480e)
- Bug 1267524 Part 12 - Use member initializer list for nsStyleContent. r=heycam (ccc17aa74a)
- Bug 1267524 Part 13 - Use member initializer list for nsStyleTextReset. r=heycam (fc8b6ae837)
- Bug 1267524 Part 14 - Use member initializer list for nsStyleText. r=heycam (d73abb7d32)
- Bug 1267524 Part 15 - Use member initializer list for nsStyleUserInterface. r=heycam (3964558f27)
- Bug 1267524 Part 16 - Use member initializer list for nsStyleUIReset. r=heycam (3154cbc7d2)
- Bug 1267524 Part 17 - Use member initializer list for nsStyleVariables. r=heycam (3d286d2299)
- Bug 1267524 Part 18 - Remove "void" from zero argument functions. r=heycam (57b1a87c19)
- Bug 1267524 Part 19 - Move nsStyleCoord members to initializer list. r=heycam (385231a406)
- Bug 1227327 - Invalidate table parts and MathML frames when background-position changes on them. r=dbaron (088fad2be7)
- Bug 1268290: stylo: Pass SheetParsingMode to Servo, r=bholley (f05d51b7b1)
- Bug 1267833 - Pass the RawServoStyleSet to Servo_GetComputedValuesForAnonymousBox. r=heycam (c4870e2005)
- Bug 1268392 - Make Servo_GetComputedValues take a node rather than an element. r=bholley (61230bdc1f)
- Bug 1268390 - Part 1: Factor out most of nsStyleSet::AddDocStyleSheet for re-use. r=bholley (5bd89657a1)
- Bug 1268390 - Part 2: Add bindings for Servo_InsertStyleSheetBefore. r=bholley (f83ea77d37)
- Bug 1268404 - Part 1: Split out ResolveStyleForText from ResolveStyleForNonElement and pass in the text node. r=bholley (dc40bbc9dc)
- Bug 1268404 - Part 2: Implement ServoStyleSet::ResolveStyleForText. r=bholley (0c6bffbd4b)
- Bug 1268748 - Implement {Resolve,Probe}PseudoElementStyle. r=heycam (cd674703d6)
- Bug 1267560 - Get style structs from ServoComputedValues rather than the rule node, when using the Servo-backed style system. r=bholley (62784ed0ee)
- Bug 1268290 followup: remove stray semicolon on a CLOSED TREE. (609540fab1)
- Bug 1268390 - Part 3: Add support for doc style sheets in ServoStyleSet. r=bholley (787cee0d54)
- Bug 1267564 - Implement a couple of Servo-backed style object methods. r=bholley (b27b0f78a0)
- Bug 1250820 - Part 1: Define scoped enum for CSSPseudoClass::Type. r=heycam (c2992f4c01)
- Bug 1250820 - Part 2: Replace nsCSSPseudoClasses::Type with CSSPseudoClassType. r=heycam (8102ab491b)
- Bug 1250820 - Part 3: Replace notPseudo with negation. r=heycam (94f4b95650)
- Bug 1250820 - Part 4: Add MAX to CSSPseudoClassType. r=heycam (85acf2bc45)
- Bug 1206961 - Use channel->AsyncOpen2() for imageLoader; Remove security checks from callsites (r=bz) (0d5b91ca12)
- Bug 1134163 - Part1.Modify animationstart event timing in order to fire event after end of pending task. r=birtles (e2c333fb8d)
- Bug 1134163 - Part2 - Modify animation tests which rely on animationstart timing. r=birtles (fb780f4298)
- Bug 1067769 - Part 1: Avoid doing RequestRestyle and mutation batch for null target. r=birtles (c3a0c1a1ef)
- Bug 1067769 - Part 2: Support nullable target in KeyframeEffect(ReadOnly) constructor. r=birtles (e8ac02ebf0)
- Bug 1067769 - Part 3: Test for KeyframeEffectReadOnly with null target. r=birtles (9ee7fc48c3)
- Bug 1067769 - Part 4: Add some simple tests for document.getAnimation() in wpt. r=birtles (77c18ad32a)
- Bug 1067769 - Part 5: Support setting KeyframeEffect.target webidl interface. r=smaug (cb450cd6f7)
- Bug 1067769 - Part 6: Rename NonOwningAnimationTarget.h to AnimationTarget.h. r=birtles (45083b4141)
- Bug 1067769 - Part 7: Define OwningAnimationTarget and use it. r=birtles (0a716665aa)
- Bug 1067769 - Part 8: Add ConvertTarget function. r=birtles (2663246043)
- Bug 1067769 - Part 9: Wrap RequestRestyle and UnregisterTarget. r=birtles (1deb75c7e0)
- Bug 1067769 - Part 10: Implement SetTarget(). r=birtles (0823f6da17)
- Bug 1067769 - Part 11: Implement animation mutation observer while setting the target. r=birtles (8224724c49)
- Bug 1067769 - Part 12: Use Maybe<OwningAnimationTarget> in KeyframeEffect(ReadOnly) constructors. r=birtles (e057c15804)
- Bug 1067769 - Part 13: Test for setting the target in basic cases. r=birtles (b6a638a268)
- Bug 1067769 - Part 14: Test for our animation mutation observer. r=birtles (5381522d25)
- Bug 1264067 - [css-grid] 'fr' min-sizing is now invalid. r=dholbert (abc7d63364)
- Bug 550426 - Add support for {background,mask}-position-{x,y}, computed style additions. r=dbaron (0dea650527)
- Bug 1266948 - text-decoration-color: currentcolor should not use value from -webkit-text-fill-color; r=jfkthame (9b36b2f493)
- Bug 1271590 - Rename timespecadd to moz_timespecadd. r=jandem (4b417dabae)
- Bug 550426 - Use background-position-x/y when detecting scroll-linked effects. r=dbaron (478331b348)
- Bug 1227327 - Use regular background drawing for XUL groupbox frames. r=mattwoodrow (db42359656)
- Bug 1260329 - Properly escape the frameTable when running |dmd.py --clamp-contents|. r=mccr8. (b40a5a0f49)
- Bug 1148544 - Update tests to work with new way of handling user agent overrides. r=jchen (2cede65d5b)
- Bug 1262326 - Make test_user_agent_overrides.html work in e10s r=nwgh (81c4d7ba00)
- Bug 1252094 - Export necko-config.h from moz.build; r=ted (0fcb2e3c2b)
- Bug 1180107: Factor out logic for determining whether a flex item's main size could influence cross size. r=mats (94b89305ea)
- Bug 1267471 - Check the snap info when comparing scroll metadata for equality. rs=botond (e5a40f0387)
- Bug 1257288 - Improve the APZ gtest infrastructure to make writing multi-FrameMetrics tests easier. r=kats (b4b898abc2)
- Bug 1256344 - Add a gtest to catch scenarios where the long-press block is interrupted by a non-touch block. r=botond (84982b1ba7)
- Bug 1265510 - Add a gtest for interrupting a scroll snap. r=botond (5f33cdadea)
- Bug 1246290 - Add a simple gtest to exercise the force-disabled-APZ codepaths. r=botond (be91113c70)
- Bug 1267470 - Move more fields from FrameMetrics to ScrollMetadata. r=kats (259f44ab15)
- Bug 1030952 part 4: For flex items with an aspect ratio, stomp on reflow state's main size *and cross size* in final reflow. r=mats (3f02ed9761)
- Bug 550426 - In PropertySupportsVariant, add {background,mask}-position-{x,y} to the list of properties that are parsed by functions. r=dbaron (b350dd9ec4)
- Bug 1258609: Initialize nsICanvasRenderingContextInternal with a DrawTarget instead of a gfxASurface. r=jrmuizel (236656c82d)
- Merge remote-tracking branch 'upstream/dev' into winbuild (c0659b547d)
- [mfbt] NotNull: VC2013 fix (86139057b8)
- layout: put back array initializations back to function body, fix VC2013 build. (3ac23f6474)
This commit is contained in:
@@ -702,7 +702,7 @@ TextAttrsMgr::TextDecorValue::
|
||||
bool isForegroundColor = false;
|
||||
textReset->GetDecorationColor(mColor, isForegroundColor);
|
||||
if (isForegroundColor)
|
||||
mColor = aFrame->StyleContext()->GetTextFillColor();
|
||||
mColor = aFrame->StyleColor()->mColor;
|
||||
|
||||
mLine = textReset->mTextDecorationLine &
|
||||
(NS_STYLE_TEXT_DECORATION_LINE_UNDERLINE |
|
||||
|
||||
@@ -165,7 +165,6 @@
|
||||
@RESPATH@/components/content_html.xpt
|
||||
@RESPATH@/components/content_xslt.xpt
|
||||
@RESPATH@/components/cookie.xpt
|
||||
@RESPATH@/components/devtools_security.xpt
|
||||
@RESPATH@/components/directory.xpt
|
||||
@RESPATH@/components/diskspacewatcher.xpt
|
||||
@RESPATH@/components/docshell.xpt
|
||||
|
||||
@@ -991,16 +991,6 @@ pref("dom.ipc.plugins.enabled", true);
|
||||
|
||||
pref("dom.ipc.shims.enabledWarnings", false);
|
||||
|
||||
// Decode using Gecko Media Plugins in <video>, if a system decoder is not
|
||||
// availble and the preferred GMP is available.
|
||||
pref("media.gmp.decoder.enabled", true);
|
||||
|
||||
// If decoding-via-GMP is turned on for <video>, use Adobe's GMP for decoding,
|
||||
// if it's available. Note: We won't fallback to another GMP if Adobe's is not
|
||||
// installed.
|
||||
pref("media.gmp.decoder.aac", 2);
|
||||
pref("media.gmp.decoder.h264", 2);
|
||||
|
||||
// Start the browser in e10s mode
|
||||
pref("browser.tabs.remote.autostart", false);
|
||||
pref("browser.tabs.remote.desktopbehavior", false);
|
||||
@@ -1219,6 +1209,9 @@ pref("browser.newtabpage.rows", 4);
|
||||
// activates the remote-hosted newtab page
|
||||
pref("browser.newtabpage.remote", false);
|
||||
|
||||
// remote newtab version targeted
|
||||
pref("browser.newtabpage.remote.version", "1");
|
||||
|
||||
// Toggles endpoints allowed for remote newtab communications
|
||||
pref("browser.newtabpage.remote.mode", "production");
|
||||
|
||||
@@ -1350,6 +1343,18 @@ pref("general.useragent.override.addons.mozilla.org","Mozilla/5.0 (Linux; X11; r
|
||||
pref("general.useragent.override.addons.mozilla.org","Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0");
|
||||
#endif
|
||||
|
||||
|
||||
// Decode using Gecko Media Plugins in <video>, if a system decoder is not
|
||||
// availble and the preferred GMP is available.
|
||||
pref("media.gmp.decoder.enabled", true);
|
||||
|
||||
// If decoding-via-GMP is turned on for <video>, use Adobe's GMP for decoding,
|
||||
// if it's available. Note: We won't fallback to another GMP if Adobe's is not
|
||||
// installed.
|
||||
pref("media.gmp.decoder.aac", 2);
|
||||
pref("media.gmp.decoder.h264", 2);
|
||||
|
||||
|
||||
// ****************** s4e prefs ******************
|
||||
pref("status4evar.addonbar.borderStyle", false);
|
||||
pref("status4evar.addonbar.closeButton", false);
|
||||
|
||||
@@ -5962,8 +5962,11 @@
|
||||
let tab = this._getDragTargetTab(event, true);
|
||||
if (!tab || dropEffect == "copy") {
|
||||
// We're adding a new tab.
|
||||
let userContextId = this.selectedItem.getAttribute("usercontextid");
|
||||
let newIndex = this._getDropIndex(event, true);
|
||||
let newTab = this.tabbrowser.loadOneTab(url, {inBackground: bgLoad, allowThirdPartyFixup: true});
|
||||
let newTab = this.tabbrowser.loadOneTab(url, {inBackground: bgLoad,
|
||||
allowThirdPartyFixup: true,
|
||||
userContextId});
|
||||
this.tabbrowser.moveTabTo(newTab, newIndex);
|
||||
} else {
|
||||
// Load in an existing tab.
|
||||
|
||||
@@ -5,4 +5,5 @@ support-files =
|
||||
file_reflect_cookie_into_title.html
|
||||
|
||||
[browser_usercontext.js]
|
||||
[browser_usercontextid_tabdrop.js]
|
||||
[browser_windowName.js]
|
||||
|
||||
@@ -0,0 +1,134 @@
|
||||
"use strict";
|
||||
|
||||
let ChromeUtils = {};
|
||||
Services.scriptloader.loadSubScript("chrome://mochikit/content/tests/SimpleTest/ChromeUtils.js", ChromeUtils);
|
||||
|
||||
/**
|
||||
* Dragging an URL to a tab without userContextId set.
|
||||
*/
|
||||
add_task(function* () {
|
||||
let tab = gBrowser.addTab("http://example.com/");
|
||||
yield BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
||||
|
||||
let awaitDrop = BrowserTestUtils.waitForEvent(gBrowser.tabContainer, "drop");
|
||||
let newTabPromise = BrowserTestUtils.waitForNewTab(gBrowser, "http://test1.example.com/");
|
||||
|
||||
// A drop type of "link" onto an existing tab would normally trigger a
|
||||
// load in that same tab, but tabbrowser code in _getDragTargetTab treats
|
||||
// drops on the outer edges of a tab differently (loading a new tab
|
||||
// instead). Make events created by synthesizeDrop have all of their
|
||||
// coordinates set to 0 (screenX/screenY), so they're treated as drops
|
||||
// on the outer edge of the tab, thus they open new tabs.
|
||||
let event = {
|
||||
clientX: 0,
|
||||
clientY: 0,
|
||||
screenX: 0,
|
||||
screenY: 0,
|
||||
};
|
||||
ChromeUtils.synthesizeDrop(tab, tab, [[{type: "text/plain", data: "http://test1.example.com/"}]], "link", window, undefined, event);
|
||||
|
||||
yield awaitDrop;
|
||||
|
||||
let tab2 = yield newTabPromise;
|
||||
Assert.ok(!tab2.hasAttribute("usercontextid"), "Tab shouldn't have usercontextid attribute");
|
||||
|
||||
yield BrowserTestUtils.browserLoaded(tab2.linkedBrowser);
|
||||
|
||||
yield ContentTask.spawn(tab2.linkedBrowser, {}, function* () {
|
||||
Assert.equal(content.document.documentURI, "http://test1.example.com/");
|
||||
Assert.equal(content.document.nodePrincipal.originAttributes.userContextId, 0);
|
||||
|
||||
// referrer is empty when urls are dragged to new or existing tabs.
|
||||
// If this changes in the future, it would be okay to send the referrer
|
||||
// in this case because we are creating a new tab with the default
|
||||
// usercontextid as the original tab.
|
||||
Assert.equal(content.document.referrer, "", "referrer should be empty");
|
||||
});
|
||||
|
||||
yield BrowserTestUtils.removeTab(tab);
|
||||
yield BrowserTestUtils.removeTab(tab2);
|
||||
});
|
||||
|
||||
/**
|
||||
* When dragging an URL to a new tab, the new tab should have the same
|
||||
* userContextId as the original tab.
|
||||
*/
|
||||
add_task(function* () {
|
||||
let tab = gBrowser.addTab("http://example.com/", {userContextId: 1});
|
||||
yield BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
||||
|
||||
let awaitDrop = BrowserTestUtils.waitForEvent(gBrowser.tabContainer, "drop");
|
||||
let newTabPromise = BrowserTestUtils.waitForNewTab(gBrowser, "http://test1.example.com/");
|
||||
|
||||
// A drop type of "link" onto an existing tab would normally trigger a
|
||||
// load in that same tab, but tabbrowser code in _getDragTargetTab treats
|
||||
// drops on the outer edges of a tab differently (loading a new tab
|
||||
// instead). Make events created by synthesizeDrop have all of their
|
||||
// coordinates set to 0 (screenX/screenY), so they're treated as drops
|
||||
// on the outer edge of the tab, thus they open new tabs.
|
||||
let event = {
|
||||
clientX: 0,
|
||||
clientY: 0,
|
||||
screenX: 0,
|
||||
screenY: 0,
|
||||
};
|
||||
ChromeUtils.synthesizeDrop(tab, tab, [[{type: "text/plain", data: "http://test1.example.com/"}]], "link", window, undefined, event);
|
||||
|
||||
yield awaitDrop;
|
||||
|
||||
let tab2 = yield newTabPromise;
|
||||
Assert.equal(tab2.getAttribute("usercontextid"), 1);
|
||||
|
||||
yield BrowserTestUtils.browserLoaded(tab2.linkedBrowser);
|
||||
|
||||
yield ContentTask.spawn(tab2.linkedBrowser, {}, function* () {
|
||||
Assert.equal(content.document.documentURI, "http://test1.example.com/");
|
||||
Assert.equal(content.document.nodePrincipal.originAttributes.userContextId, 1);
|
||||
|
||||
// referrer is empty when urls are dragged to new or existing tabs.
|
||||
// If this changes in the future, it would be okay to send the referrer
|
||||
// in this case because we are creating a new tab with the same
|
||||
// usercontextid as the original tab.
|
||||
Assert.equal(content.document.referrer, "", "referrer should be empty");
|
||||
});
|
||||
|
||||
yield BrowserTestUtils.removeTab(tab);
|
||||
yield BrowserTestUtils.removeTab(tab2);
|
||||
});
|
||||
|
||||
/**
|
||||
* When dragging a URL from one tab or link on a tab to an existing tab, the
|
||||
* existing tab should not change its userContextId.
|
||||
* Ex: if you drag a link from tab 1 with userContext 1 to tab 2 with
|
||||
* userContext 2, the link will open in tab 2 with userContext 2.
|
||||
*/
|
||||
add_task(function* () {
|
||||
let tab = gBrowser.addTab("http://example.com/", {userContextId: 1});
|
||||
yield BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
||||
|
||||
let tab2 = gBrowser.addTab("http://example.org/", {userContextId: 2});
|
||||
yield BrowserTestUtils.browserLoaded(tab2.linkedBrowser);
|
||||
|
||||
let awaitDrop = BrowserTestUtils.waitForEvent(gBrowser.tabContainer, "drop");
|
||||
|
||||
ChromeUtils.synthesizeDrop(tab, tab2, [[{type: "text/plain", data: "http://test1.example.com/"}]], "link", window);
|
||||
|
||||
yield awaitDrop;
|
||||
Assert.equal(tab2.getAttribute("usercontextid"), 2);
|
||||
|
||||
yield BrowserTestUtils.browserLoaded(tab2.linkedBrowser);
|
||||
|
||||
yield ContentTask.spawn(tab2.linkedBrowser, {}, function* () {
|
||||
Assert.equal(content.document.documentURI, "http://test1.example.com/");
|
||||
Assert.equal(content.document.nodePrincipal.originAttributes.userContextId, 2);
|
||||
|
||||
// referrer is empty when urls are dragged to new or existing tabs.
|
||||
// If this changes in the future, we should ensure that we are not sending
|
||||
// a referrer for this case! When opening links across user contexts, we
|
||||
// don't want the referrer to follow the user from one context to another.
|
||||
Assert.equal(content.document.referrer, "", "referrer should be empty");
|
||||
});
|
||||
|
||||
yield BrowserTestUtils.removeTab(tab);
|
||||
yield BrowserTestUtils.removeTab(tab2);
|
||||
});
|
||||
@@ -19,6 +19,7 @@ XPCOMUtils.defineLazyGetter(this, "EventEmitter", function() {
|
||||
const gPrefsMap = new Map([
|
||||
["browser.newtabpage.remote", "bool"],
|
||||
["browser.newtabpage.remote.mode", "str"],
|
||||
["browser.newtabpage.remote.version", "str"],
|
||||
["browser.newtabpage.enabled", "bool"],
|
||||
["browser.newtabpage.enhanced", "bool"],
|
||||
["browser.newtabpage.introShown", "bool"],
|
||||
|
||||
@@ -44,9 +44,10 @@ const PREF_SELECTED_LOCALE = "general.useragent.locale";
|
||||
// The preference that tells what remote mode is enabled.
|
||||
const PREF_REMOTE_MODE = "browser.newtabpage.remote.mode";
|
||||
|
||||
const VALID_CHANNELS = new Set(["esr", "release", "beta", "aurora", "nightly"]);
|
||||
// The preference that tells which remote version is expected.
|
||||
const PREF_REMOTE_VERSION = "browser.newtabpage.remote.version";
|
||||
|
||||
const REMOTE_NEWTAB_VERSION = "0";
|
||||
const VALID_CHANNELS = new Set(["esr", "release", "beta", "aurora", "nightly"]);
|
||||
|
||||
function AboutNewTabService() {
|
||||
NewTabPrefsProvider.prefs.on(PREF_REMOTE_ENABLED, this._handleToggleEvent.bind(this));
|
||||
@@ -145,11 +146,15 @@ AboutNewTabService.prototype = {
|
||||
NewTabPrefsProvider.prefs.on(
|
||||
PREF_REMOTE_MODE,
|
||||
this._updateRemoteMaybe);
|
||||
NewTabPrefsProvider.prefs.on(
|
||||
PREF_REMOTE_VERSION,
|
||||
this._updateRemoteMaybe);
|
||||
this._remoteEnabled = true;
|
||||
} else {
|
||||
NewTabPrefsProvider.prefs.off(PREF_SELECTED_LOCALE, this._updateRemoteMaybe);
|
||||
NewTabPrefsProvider.prefs.off(PREF_MATCH_OS_LOCALE, this._updateRemoteMaybe);
|
||||
NewTabPrefsProvider.prefs.off(PREF_REMOTE_MODE, this._updateRemoteMaybe);
|
||||
NewTabPrefsProvider.prefs.off(PREF_REMOTE_VERSION, this._updateRemoteMaybe);
|
||||
this._remoteEnabled = false;
|
||||
}
|
||||
if (!csTest) {
|
||||
@@ -164,7 +169,7 @@ AboutNewTabService.prototype = {
|
||||
generateRemoteURL() {
|
||||
let releaseName = this.releaseFromUpdateChannel(UpdateUtils.UpdateChannel);
|
||||
let path = REMOTE_NEWTAB_PATH
|
||||
.replace("%VERSION%", REMOTE_NEWTAB_VERSION)
|
||||
.replace("%VERSION%", this.remoteVersion)
|
||||
.replace("%LOCALE%", Locale.getLocale())
|
||||
.replace("%CHANNEL%", releaseName);
|
||||
let mode = Services.prefs.getCharPref(PREF_REMOTE_MODE, "production");
|
||||
@@ -224,7 +229,7 @@ AboutNewTabService.prototype = {
|
||||
},
|
||||
|
||||
get remoteVersion() {
|
||||
return REMOTE_NEWTAB_VERSION;
|
||||
return Services.prefs.getCharPref(PREF_REMOTE_VERSION, "1");
|
||||
},
|
||||
|
||||
get remoteReleaseName() {
|
||||
|
||||
@@ -18,12 +18,17 @@ XPCOMUtils.defineLazyServiceGetter(this, "aboutNewTabService",
|
||||
"@mozilla.org/browser/aboutnewtab-service;1",
|
||||
"nsIAboutNewTabService");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Locale",
|
||||
"resource://gre/modules/Locale.jsm");
|
||||
|
||||
const DEFAULT_HREF = aboutNewTabService.generateRemoteURL();
|
||||
const DEFAULT_CHROME_URL = "chrome://browser/content/newtab/newTab.xhtml";
|
||||
const DOWNLOADS_URL = "chrome://browser/content/downloads/contentAreaDownloadsView.xul";
|
||||
const DEFAULT_VERSION = aboutNewTabService.remoteVersion;
|
||||
|
||||
function cleanup() {
|
||||
Services.prefs.setBoolPref("browser.newtabpage.remote", false);
|
||||
Services.prefs.setCharPref("browser.newtabpage.remote.version", DEFAULT_VERSION);
|
||||
aboutNewTabService.resetNewTabURL();
|
||||
NewTabPrefsProvider.prefs.uninit();
|
||||
}
|
||||
@@ -107,7 +112,8 @@ add_task(function* test_updates() {
|
||||
let notificationPromise;
|
||||
let productionModeBaseUrl = "https://content.cdn.mozilla.net";
|
||||
let testModeBaseUrl = "https://example.com";
|
||||
let expectedPath = `/v${aboutNewTabService.remoteVersion}` +
|
||||
let expectedPath = `/newtab` +
|
||||
`/v${aboutNewTabService.remoteVersion}` +
|
||||
`/${aboutNewTabService.remoteReleaseName}` +
|
||||
"/en-GB" +
|
||||
"/index.html";
|
||||
@@ -193,6 +199,32 @@ add_task(function* test_release_names() {
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Verifies that remote version updates changes the remote newtab url
|
||||
*/
|
||||
add_task(function* test_version_update() {
|
||||
NewTabPrefsProvider.prefs.init();
|
||||
|
||||
Services.prefs.setBoolPref("browser.newtabpage.remote", true);
|
||||
Assert.ok(aboutNewTabService.remoteEnabled, "remote mode enabled");
|
||||
|
||||
let productionModeBaseUrl = "https://content.cdn.mozilla.net";
|
||||
let version_incr = String(parseInt(DEFAULT_VERSION) + 1);
|
||||
let expectedPath = `/newtab` +
|
||||
`/v${version_incr}` +
|
||||
`/${aboutNewTabService.remoteReleaseName}` +
|
||||
`/${Locale.getLocale()}` +
|
||||
`/index.html`;
|
||||
let expectedHref = productionModeBaseUrl + expectedPath;
|
||||
|
||||
let notificationPromise;
|
||||
notificationPromise = nextChangeNotificationPromise(expectedHref);
|
||||
Preferences.set("browser.newtabpage.remote.version", version_incr);
|
||||
yield notificationPromise;
|
||||
|
||||
cleanup();
|
||||
});
|
||||
|
||||
function nextChangeNotificationPromise(aNewURL, testMessage) {
|
||||
return new Promise(resolve => {
|
||||
Services.obs.addObserver(function observer(aSubject, aTopic, aData) { // jshint unused:false
|
||||
|
||||
@@ -145,6 +145,9 @@ XPCOMUtils.defineLazyModuleGetter(this, "ExtensionManagement",
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "ShellService",
|
||||
"resource:///modules/ShellService.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "WindowsRegistry",
|
||||
"resource://gre/modules/WindowsRegistry.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "AlertsService",
|
||||
"@mozilla.org/alerts-service;1", "nsIAlertsService");
|
||||
|
||||
@@ -851,9 +854,13 @@ BrowserGlue.prototype = {
|
||||
},
|
||||
|
||||
/**
|
||||
* Show a notification bar offering a reset if the profile has been unused for some time.
|
||||
* Show a notification bar offering a reset.
|
||||
*
|
||||
* @param reason
|
||||
* String of either "unused" or "uninstall", specifying the reason
|
||||
* why a profile reset is offered.
|
||||
*/
|
||||
_resetUnusedProfileNotification: function () {
|
||||
_resetProfileNotification: function (reason) {
|
||||
let win = RecentWindow.getMostRecentBrowserWindow();
|
||||
if (!win)
|
||||
return;
|
||||
@@ -866,7 +873,14 @@ BrowserGlue.prototype = {
|
||||
let resetBundle = Services.strings
|
||||
.createBundle("chrome://global/locale/resetProfile.properties");
|
||||
|
||||
let message = resetBundle.formatStringFromName("resetUnusedProfile.message", [productName], 1);
|
||||
let message;
|
||||
if (reason == "unused") {
|
||||
message = resetBundle.formatStringFromName("resetUnusedProfile.message", [productName], 1);
|
||||
} else if (reason == "uninstall") {
|
||||
message = resetBundle.formatStringFromName("resetUninstalled.message", [productName], 1);
|
||||
} else {
|
||||
throw new Error(`Unknown reason (${reason}) given to _resetProfileNotification.`);
|
||||
}
|
||||
let buttons = [
|
||||
{
|
||||
label: resetBundle.formatStringFromName("refreshProfile.resetButton.label", [productName], 1),
|
||||
@@ -878,7 +892,7 @@ BrowserGlue.prototype = {
|
||||
];
|
||||
|
||||
let nb = win.document.getElementById("global-notificationbox");
|
||||
nb.appendNotification(message, "reset-unused-profile",
|
||||
nb.appendNotification(message, "reset-profile-notification",
|
||||
"chrome://global/skin/icons/question-16.png",
|
||||
nb.PRIORITY_INFO_LOW, buttons);
|
||||
},
|
||||
@@ -964,11 +978,34 @@ BrowserGlue.prototype = {
|
||||
|
||||
// Offer to reset a user's profile if it hasn't been used for 60 days.
|
||||
const OFFER_PROFILE_RESET_INTERVAL_MS = 60 * 24 * 60 * 60 * 1000;
|
||||
let processStartupTime = Services.startup.getStartupInfo().process;
|
||||
let lastUse = Services.appinfo.replacedLockTime;
|
||||
if (processStartupTime && lastUse &&
|
||||
processStartupTime.getTime() - lastUse >= OFFER_PROFILE_RESET_INTERVAL_MS) {
|
||||
this._resetUnusedProfileNotification();
|
||||
let disableResetPrompt = false;
|
||||
try {
|
||||
disableResetPrompt = Services.prefs.getBoolPref("browser.disableResetPrompt");
|
||||
} catch(e) {}
|
||||
|
||||
if (!disableResetPrompt && lastUse &&
|
||||
Date.now() - lastUse >= OFFER_PROFILE_RESET_INTERVAL_MS) {
|
||||
this._resetProfileNotification("unused");
|
||||
} else if (AppConstants.platform == "win" && !disableResetPrompt) {
|
||||
// Check if we were just re-installed and offer Firefox Reset
|
||||
let updateChannel;
|
||||
try {
|
||||
updateChannel = Cu.import("resource://gre/modules/UpdateUtils.jsm", {}).UpdateUtils.UpdateChannel;
|
||||
} catch (ex) {}
|
||||
if (updateChannel) {
|
||||
let uninstalledValue =
|
||||
WindowsRegistry.readRegKey(Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
|
||||
"Software\\Mozilla\\Firefox",
|
||||
`Uninstalled-${updateChannel}`);
|
||||
let removalSuccessful =
|
||||
WindowsRegistry.removeRegKey(Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
|
||||
"Software\\Mozilla\\Firefox",
|
||||
`Uninstalled-${updateChannel}`);
|
||||
if (removalSuccessful && uninstalledValue == "True") {
|
||||
this._resetProfileNotification("uninstall");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this._firstWindowTelemetry(aWindow);
|
||||
|
||||
@@ -50,6 +50,9 @@
|
||||
#include <mbstring.h>
|
||||
#include <shlwapi.h>
|
||||
|
||||
#include <lm.h>
|
||||
#undef ACCESS_READ
|
||||
|
||||
#ifndef MAX_BUF
|
||||
#define MAX_BUF 4096
|
||||
#endif
|
||||
@@ -841,9 +844,96 @@ nsWindowsShellService::LaunchControlPanelDefaultsSelectionUI()
|
||||
return SUCCEEDED(hr) ? NS_OK : NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsWindowsShellService::LaunchControlPanelDefaultPrograms()
|
||||
{
|
||||
// Default Programs is a Vista+ feature
|
||||
if (!IsVistaOrLater()) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
// Build the path control.exe path safely
|
||||
WCHAR controlEXEPath[MAX_PATH + 1] = { '\0' };
|
||||
if (!GetSystemDirectoryW(controlEXEPath, MAX_PATH)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
LPCWSTR controlEXE = L"control.exe";
|
||||
if (wcslen(controlEXEPath) + wcslen(controlEXE) >= MAX_PATH) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
if (!PathAppendW(controlEXEPath, controlEXE)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
WCHAR params[] = L"control.exe /name Microsoft.DefaultPrograms /page pageDefaultProgram";
|
||||
STARTUPINFOW si = {sizeof(si), 0};
|
||||
si.dwFlags = STARTF_USESHOWWINDOW;
|
||||
si.wShowWindow = SW_SHOWDEFAULT;
|
||||
PROCESS_INFORMATION pi = {0};
|
||||
if (!CreateProcessW(controlEXEPath, params, nullptr, nullptr, FALSE,
|
||||
0, nullptr, nullptr, &si, &pi)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
CloseHandle(pi.hProcess);
|
||||
CloseHandle(pi.hThread);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
static bool
|
||||
IsWindowsLogonConnected()
|
||||
{
|
||||
WCHAR userName[UNLEN + 1];
|
||||
DWORD size = ArrayLength(userName);
|
||||
if (!GetUserNameW(userName, &size)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
LPUSER_INFO_24 info;
|
||||
if (NetUserGetInfo(nullptr, userName, 24, (LPBYTE *)&info)
|
||||
!= NERR_Success) {
|
||||
return false;
|
||||
}
|
||||
bool connected = info->usri24_internet_identity;
|
||||
NetApiBufferFree(info);
|
||||
|
||||
return connected;
|
||||
}
|
||||
|
||||
static bool
|
||||
SettingsAppBelievesConnected()
|
||||
{
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIWindowsRegKey> regKey =
|
||||
do_CreateInstance("@mozilla.org/windows-registry-key;1", &rv);
|
||||
if (NS_FAILED(rv)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
rv = regKey->Open(nsIWindowsRegKey::ROOT_KEY_CURRENT_USER,
|
||||
NS_LITERAL_STRING("SOFTWARE\\Microsoft\\Windows\\Shell\\Associations"),
|
||||
nsIWindowsRegKey::ACCESS_READ);
|
||||
if (NS_FAILED(rv)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32_t value;
|
||||
rv = regKey->ReadIntValue(NS_LITERAL_STRING("IsConnectedAtLogon"), &value);
|
||||
if (NS_FAILED(rv)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return !!value;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsWindowsShellService::LaunchModernSettingsDialogDefaultApps()
|
||||
{
|
||||
if (!IsWindowsLogonConnected() && SettingsAppBelievesConnected()) {
|
||||
// Use the classic Control Panel to work around a bug of Windows 10.
|
||||
return LaunchControlPanelDefaultPrograms();
|
||||
}
|
||||
|
||||
IApplicationActivationManager* pActivator;
|
||||
HRESULT hr = CoCreateInstance(CLSID_ApplicationActivationManager,
|
||||
nullptr,
|
||||
|
||||
@@ -28,6 +28,7 @@ public:
|
||||
protected:
|
||||
bool IsDefaultBrowserVista(bool aCheckAllTypes, bool* aIsDefaultBrowser);
|
||||
nsresult LaunchControlPanelDefaultsSelectionUI();
|
||||
nsresult LaunchControlPanelDefaultPrograms();
|
||||
nsresult LaunchModernSettingsDialogDefaultApps();
|
||||
nsresult InvokeHTTPOpenAsVerb();
|
||||
nsresult LaunchHTTPHandlerPane();
|
||||
|
||||
@@ -197,7 +197,6 @@
|
||||
#endif
|
||||
@RESPATH@/components/content_xslt.xpt
|
||||
@RESPATH@/components/cookie.xpt
|
||||
@RESPATH@/browser/components/devtools_security.xpt
|
||||
@RESPATH@/components/directory.xpt
|
||||
@RESPATH@/components/docshell.xpt
|
||||
@RESPATH@/components/dom.xpt
|
||||
|
||||
@@ -414,6 +414,13 @@ Section "Uninstall"
|
||||
; clients registry key by the OS under some conditions.
|
||||
System::Call "shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i 0, i 0, i 0)"
|
||||
|
||||
; Users who uninstall then reinstall expecting Firefox to use a clean profile
|
||||
; may be surprised during first-run. This key is checked during startup of Firefox and
|
||||
; subsequently deleted after checking. If the value is found during startup
|
||||
; the browser will offer to Reset Firefox. We use the UpdateChannel to match
|
||||
; uninstalls of Firefox-release with reinstalls of Firefox-release, for example.
|
||||
WriteRegStr HKCU "Software\Mozilla\Arctic Fox" "Uninstalled-${UpdateChannel}" "True"
|
||||
|
||||
SectionEnd
|
||||
|
||||
################################################################################
|
||||
|
||||
Vendored
+1
@@ -269,6 +269,7 @@ NSS_Init
|
||||
NSS_Initialize
|
||||
NSS_InitWithMerge
|
||||
NSS_IsInitialized
|
||||
NSS_OptionSet
|
||||
NSS_NoDB_Init
|
||||
NSS_SecureMemcmp
|
||||
NSS_SecureMemcmpZero
|
||||
|
||||
@@ -3170,9 +3170,7 @@ function parseAttributeValues(attr, doc) {
|
||||
}
|
||||
}
|
||||
|
||||
// Attributes return from DOMParser in reverse order from how they are
|
||||
// entered.
|
||||
return attributes.reverse();
|
||||
return attributes;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -168,7 +168,7 @@ function* testDocumentElement(inspector, testActor) {
|
||||
function* testDocumentElement2(inspector, testActor) {
|
||||
let currentDocElementOuterHMTL = yield testActor.eval(
|
||||
"content.document.documentElement.outerHMTL");
|
||||
let docElementHTML = "<html class=\"updated\" id=\"somethingelse\"><head>" +
|
||||
let docElementHTML = "<html id=\"somethingelse\" class=\"updated\"><head>" +
|
||||
"<title>Updated again from document element</title>" +
|
||||
"<script>window.foo=\"bar\";</script></head><body>" +
|
||||
"<p>Hello again</p></body></html>";
|
||||
|
||||
@@ -51,8 +51,8 @@ function makeColorTest(name, value, segments) {
|
||||
result.expected += segment;
|
||||
} else {
|
||||
result.expected += "<span data-color=\"" + segment.name + "\">" +
|
||||
"<span style=\"background-color:" + segment.name +
|
||||
"\" class=\"" + COLOR_TEST_CLASS + "\"></span><span>" +
|
||||
"<span class=\"" + COLOR_TEST_CLASS + "\" style=\"background-color:" +
|
||||
segment.name + "\"></span><span>" +
|
||||
segment.name + "</span></span>";
|
||||
}
|
||||
}
|
||||
@@ -241,8 +241,8 @@ function testParseURL(doc, parser) {
|
||||
let expectedTrailer = test.expectedTrailer || test.trailer;
|
||||
|
||||
let expected = test.leader +
|
||||
"<a href=\"something.jpg\" class=\"test-urlclass\" " +
|
||||
"target=\"_blank\">something.jpg</a>" +
|
||||
"<a target=\"_blank\" class=\"test-urlclass\" " +
|
||||
"href=\"something.jpg\">something.jpg</a>" +
|
||||
expectedTrailer;
|
||||
|
||||
is(target.innerHTML, expected, test.desc);
|
||||
|
||||
@@ -19,7 +19,7 @@ const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
|
||||
var inputTests = [
|
||||
{
|
||||
input: "testBodyNode()",
|
||||
output: '<body id="body-id" class="body-class">',
|
||||
output: '<body class="body-class" id="body-id">',
|
||||
printOutput: "[object HTMLBodyElement]",
|
||||
inspectable: true,
|
||||
noClick: true,
|
||||
@@ -28,7 +28,7 @@ var inputTests = [
|
||||
|
||||
{
|
||||
input: "testDocumentElement()",
|
||||
output: '<html lang="en-US" dir="ltr">',
|
||||
output: '<html dir="ltr" lang="en-US">',
|
||||
printOutput: "[object HTMLHtmlElement]",
|
||||
inspectable: true,
|
||||
noClick: true,
|
||||
@@ -102,7 +102,7 @@ var inputTests = [
|
||||
|
||||
{
|
||||
input: "testLotsOfAttributes()",
|
||||
output: '<p n="" m="" l="" k="" j="" i="" h="" g="" f="" e="" d="" c="" b="" a="" id="lots-of-attributes">',
|
||||
output: '<p id="lots-of-attributes" a="" b="" c="" d="" e="" f="" g="" h="" i="" j="" k="" l="" m="" n="">',
|
||||
printOutput: "[object HTMLParagraphElement]",
|
||||
inspectable: true,
|
||||
noClick: true,
|
||||
|
||||
@@ -23,7 +23,7 @@ const TEST_DATA = [
|
||||
},
|
||||
{
|
||||
input: "testBodyNode()",
|
||||
output: '<body id="body-id" class="body-class">',
|
||||
output: '<body class="body-class" id="body-id">',
|
||||
tagName: "BODY",
|
||||
attrs: [
|
||||
{
|
||||
@@ -42,7 +42,7 @@ const TEST_DATA = [
|
||||
},
|
||||
{
|
||||
input: "testDocumentElement()",
|
||||
output: '<html lang="en-US" dir="ltr">',
|
||||
output: '<html dir="ltr" lang="en-US">',
|
||||
tagName: "HTML",
|
||||
attrs: [
|
||||
{
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
|
||||
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
// Test that inspector links in the webconsole output for DOM Nodes do not try
|
||||
// to highlight or select nodes once they have been detached
|
||||
|
||||
"use strict";
|
||||
|
||||
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
|
||||
"test/test-console-output-dom-elements.html";
|
||||
|
||||
const TEST_DATA = [
|
||||
{
|
||||
// The first test shouldn't be returning the body element as this is the
|
||||
// default selected node, so re-selecting it won't fire the
|
||||
// inspector-updated event
|
||||
input: "testNode()",
|
||||
output: '<p some-attribute="some-value">'
|
||||
},
|
||||
{
|
||||
input: "testBodyNode()",
|
||||
output: '<body class="body-class" id="body-id">'
|
||||
},
|
||||
{
|
||||
input: "testNodeInIframe()",
|
||||
output: "<p>"
|
||||
},
|
||||
{
|
||||
input: "testDocumentElement()",
|
||||
output: '<html dir="ltr" lang="en-US">'
|
||||
}
|
||||
];
|
||||
|
||||
const PREF = "devtools.webconsole.persistlog";
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref(PREF, true);
|
||||
registerCleanupFunction(() => Services.prefs.clearUserPref(PREF));
|
||||
|
||||
Task.spawn(function*() {
|
||||
let {tab} = yield loadTab(TEST_URI);
|
||||
let hud = yield openConsole(tab);
|
||||
let toolbox = gDevTools.getToolbox(hud.target);
|
||||
|
||||
info("Executing the test data");
|
||||
let widgets = [];
|
||||
for (let data of TEST_DATA) {
|
||||
let [result] = yield jsEval(data.input, hud, {text: data.output});
|
||||
let {widget} = yield getWidgetAndMessage(result);
|
||||
widgets.push(widget);
|
||||
}
|
||||
|
||||
info("Reloading the page");
|
||||
yield reloadPage();
|
||||
|
||||
info("Iterating over the ElementNode widgets");
|
||||
for (let widget of widgets) {
|
||||
// Verify that openNodeInInspector rejects since the associated dom node
|
||||
// doesn't exist anymore
|
||||
yield widget.openNodeInInspector().then(() => {
|
||||
ok(false, "The openNodeInInspector promise resolved");
|
||||
}, () => {
|
||||
ok(true, "The openNodeInInspector promise rejected as expected");
|
||||
});
|
||||
yield toolbox.selectTool("webconsole");
|
||||
|
||||
// Verify that highlightDomNode rejects too, for the same reason
|
||||
yield widget.highlightDomNode().then(() => {
|
||||
ok(false, "The highlightDomNode promise resolved");
|
||||
}, () => {
|
||||
ok(true, "The highlightDomNode promise rejected as expected");
|
||||
});
|
||||
}
|
||||
}).then(finishTest);
|
||||
}
|
||||
|
||||
function jsEval(input, hud, message) {
|
||||
info("Executing '" + input + "' in the web console");
|
||||
hud.jsterm.execute(input);
|
||||
return waitForMessages({
|
||||
webconsole: hud,
|
||||
messages: [message]
|
||||
});
|
||||
}
|
||||
|
||||
function* getWidgetAndMessage(result) {
|
||||
info("Getting the output ElementNode widget");
|
||||
|
||||
let msg = [...result.matched][0];
|
||||
let widget = [...msg._messageObject.widgets][0];
|
||||
ok(widget, "ElementNode widget found in the output");
|
||||
|
||||
info("Waiting for the ElementNode widget to be linked to the inspector");
|
||||
yield widget.linkToInspector();
|
||||
|
||||
return {widget: widget, msg: msg};
|
||||
}
|
||||
|
||||
function reloadPage() {
|
||||
let def = promise.defer();
|
||||
gBrowser.selectedBrowser.addEventListener("load", function onload() {
|
||||
gBrowser.selectedBrowser.removeEventListener("load", onload, true);
|
||||
def.resolve();
|
||||
}, true);
|
||||
content.location.reload();
|
||||
return def.promise;
|
||||
}
|
||||
@@ -423,10 +423,7 @@ var NodeActor = exports.NodeActor = protocol.ActorClass({
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// The NamedNodeMap implementation in Firefox (returned by
|
||||
// node.attributes) gives attributes in the reverse order compared
|
||||
// to the source file when iterated. So reverse the list here.
|
||||
return [...this.rawNode.attributes].reverse().map(attr => {
|
||||
return [...this.rawNode.attributes].map(attr => {
|
||||
return {namespace: attr.namespace, name: attr.name, value: attr.value };
|
||||
});
|
||||
},
|
||||
|
||||
@@ -156,7 +156,7 @@ window.onload = function() {
|
||||
desc: "Search with multiple matches in a single tag expecting a single result",
|
||||
search: "💩",
|
||||
expected: [
|
||||
{node: inspectee.getElementById("💩"), type: "attributeName"}
|
||||
{node: inspectee.getElementById("💩"), type: "attributeValue"}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
@@ -6,18 +6,6 @@
|
||||
|
||||
XPCSHELL_TESTS_MANIFESTS += ['tests/unit/xpcshell.ini']
|
||||
|
||||
XPIDL_SOURCES += [
|
||||
'nsILocalCertService.idl',
|
||||
]
|
||||
|
||||
XPIDL_MODULE = 'devtools_security'
|
||||
|
||||
UNIFIED_SOURCES += [
|
||||
'LocalCertService.cpp',
|
||||
]
|
||||
|
||||
FINAL_LIBRARY = 'xul'
|
||||
|
||||
DevToolsModules(
|
||||
'auth.js',
|
||||
'cert.js',
|
||||
|
||||
@@ -8,9 +8,11 @@ skip-if = toolkit == 'gonk' && debug # Bug 1206586
|
||||
support-files=
|
||||
testactors.js
|
||||
|
||||
[test_cert.js]
|
||||
[test_encryption.js]
|
||||
# Failures on B2G emulator debug, B2G emulator-x86-kk
|
||||
# See bug 1234972 and bug 1199472
|
||||
skip-if = toolkit == 'gonk' && (debug || android_version > '15')
|
||||
[test_oob_cert_auth.js]
|
||||
# Failures on B2G emulator debug and Android opt
|
||||
# See bug 1141544, bug 1163052, and bug 1166032
|
||||
skip-if = (toolkit == 'gonk' && debug) || (toolkit == 'android' && !debug)
|
||||
# Failures on B2G emulator debug, B2G emulator-x86-kk and Android opt
|
||||
# See bug 1141544, bug 1163052, bug 1166032 and bug 1241831
|
||||
skip-if = (toolkit == 'gonk' && (debug || android_version > '15')) || (toolkit == 'android' && !debug)
|
||||
|
||||
@@ -13319,7 +13319,7 @@ nsDocShell::SetBaseUrlForWyciwyg(nsIContentViewer* aContentViewer)
|
||||
if (baseURI) {
|
||||
nsIDocument* document = aContentViewer->GetDocument();
|
||||
if (document) {
|
||||
rv = document->SetBaseURI(baseURI);
|
||||
document->SetBaseURI(baseURI);
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
#include "AnimationUtils.h"
|
||||
#include "mozilla/dom/AnimationBinding.h"
|
||||
#include "mozilla/dom/AnimationPlaybackEvent.h"
|
||||
#include "mozilla/AnimationTarget.h"
|
||||
#include "mozilla/AutoRestore.h"
|
||||
#include "mozilla/AsyncEventDispatcher.h" // For AsyncEventDispatcher
|
||||
#include "mozilla/Maybe.h" // For Maybe
|
||||
#include "mozilla/NonOwningAnimationTarget.h"
|
||||
#include "nsAnimationManager.h" // For CSSAnimation
|
||||
#include "nsDOMMutationObserver.h" // For nsAutoAnimationMutationBatch
|
||||
#include "nsIDocument.h" // For nsIDocument
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* 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/. */
|
||||
|
||||
#ifndef mozilla_AnimationTarget_h
|
||||
#define mozilla_AnimationTarget_h
|
||||
|
||||
#include "mozilla/Attributes.h" // For MOZ_NON_OWNING_REF
|
||||
#include "mozilla/Maybe.h"
|
||||
#include "mozilla/RefPtr.h"
|
||||
#include "nsCSSPseudoElements.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
namespace dom {
|
||||
class Element;
|
||||
} // namespace dom
|
||||
|
||||
struct OwningAnimationTarget
|
||||
{
|
||||
OwningAnimationTarget(dom::Element* aElement, CSSPseudoElementType aType)
|
||||
: mElement(aElement), mPseudoType(aType) { }
|
||||
|
||||
explicit OwningAnimationTarget(dom::Element* aElement)
|
||||
: mElement(aElement) { }
|
||||
|
||||
bool operator==(const OwningAnimationTarget& aOther) const
|
||||
{
|
||||
return mElement == aOther.mElement &&
|
||||
mPseudoType == aOther.mPseudoType;
|
||||
}
|
||||
|
||||
// mElement represents the parent element of a pseudo-element, not the
|
||||
// generated content element.
|
||||
RefPtr<dom::Element> mElement;
|
||||
CSSPseudoElementType mPseudoType = CSSPseudoElementType::NotPseudo;
|
||||
};
|
||||
|
||||
struct NonOwningAnimationTarget
|
||||
{
|
||||
NonOwningAnimationTarget(dom::Element* aElement, CSSPseudoElementType aType)
|
||||
: mElement(aElement), mPseudoType(aType) { }
|
||||
|
||||
explicit NonOwningAnimationTarget(const OwningAnimationTarget& aOther)
|
||||
: mElement(aOther.mElement), mPseudoType(aOther.mPseudoType) { }
|
||||
|
||||
// mElement represents the parent element of a pseudo-element, not the
|
||||
// generated content element.
|
||||
dom::Element* MOZ_NON_OWNING_REF mElement = nullptr;
|
||||
CSSPseudoElementType mPseudoType = CSSPseudoElementType::NotPseudo;
|
||||
};
|
||||
|
||||
|
||||
// Helper functions for cycle-collecting Maybe<OwningAnimationTarget>
|
||||
inline void
|
||||
ImplCycleCollectionTraverse(nsCycleCollectionTraversalCallback& aCallback,
|
||||
Maybe<OwningAnimationTarget>& aTarget,
|
||||
const char* aName,
|
||||
uint32_t aFlags = 0)
|
||||
{
|
||||
if (aTarget) {
|
||||
ImplCycleCollectionTraverse(aCallback, aTarget->mElement, aName, aFlags);
|
||||
}
|
||||
}
|
||||
|
||||
inline void
|
||||
ImplCycleCollectionUnlink(Maybe<OwningAnimationTarget>& aTarget)
|
||||
{
|
||||
if (aTarget) {
|
||||
ImplCycleCollectionUnlink(aTarget->mElement);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
||||
|
||||
#endif // mozilla_AnimationTarget_h
|
||||
@@ -9,8 +9,9 @@
|
||||
#include "mozilla/dom/Animation.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/dom/KeyframeEffect.h" // For KeyframeEffectReadOnly
|
||||
#include "mozilla/AnimationUtils.h"
|
||||
#include "mozilla/AnimationPerformanceWarning.h"
|
||||
#include "mozilla/AnimationTarget.h"
|
||||
#include "mozilla/AnimationUtils.h"
|
||||
#include "mozilla/EffectSet.h"
|
||||
#include "mozilla/InitializerList.h"
|
||||
#include "mozilla/LayerAnimationInfo.h"
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#include "mozilla/EnumeratedArray.h"
|
||||
#include "mozilla/Maybe.h"
|
||||
#include "mozilla/OwningNonNull.h"
|
||||
#include "mozilla/NonOwningAnimationTarget.h"
|
||||
#include "mozilla/PseudoElementHashEntry.h"
|
||||
#include "mozilla/RefPtr.h"
|
||||
#include "nsCSSProperty.h"
|
||||
@@ -30,6 +29,7 @@ namespace mozilla {
|
||||
class EffectSet;
|
||||
class RestyleTracker;
|
||||
struct AnimationPerformanceWarning;
|
||||
struct NonOwningAnimationTarget;
|
||||
|
||||
namespace dom {
|
||||
class Animation;
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include "mozilla/dom/AnimatableBinding.h"
|
||||
#include "mozilla/dom/KeyframeEffectBinding.h"
|
||||
#include "mozilla/AnimationUtils.h"
|
||||
#include "mozilla/EffectCompositor.h"
|
||||
#include "mozilla/FloatingPoint.h"
|
||||
#include "mozilla/LookAndFeel.h" // For LookAndFeel::GetInt
|
||||
#include "mozilla/KeyframeUtils.h"
|
||||
@@ -76,10 +75,9 @@ NS_IMPL_RELEASE_INHERITED(KeyframeEffectReadOnly, AnimationEffectReadOnly)
|
||||
|
||||
KeyframeEffectReadOnly::KeyframeEffectReadOnly(
|
||||
nsIDocument* aDocument,
|
||||
Element* aTarget,
|
||||
CSSPseudoElementType aPseudoType,
|
||||
const Maybe<OwningAnimationTarget>& aTarget,
|
||||
const TimingParams& aTiming)
|
||||
: KeyframeEffectReadOnly(aDocument, aTarget, aPseudoType,
|
||||
: KeyframeEffectReadOnly(aDocument, aTarget,
|
||||
new AnimationEffectTimingReadOnly(aDocument,
|
||||
aTiming))
|
||||
{
|
||||
@@ -87,17 +85,14 @@ KeyframeEffectReadOnly::KeyframeEffectReadOnly(
|
||||
|
||||
KeyframeEffectReadOnly::KeyframeEffectReadOnly(
|
||||
nsIDocument* aDocument,
|
||||
Element* aTarget,
|
||||
CSSPseudoElementType aPseudoType,
|
||||
const Maybe<OwningAnimationTarget>& aTarget,
|
||||
AnimationEffectTimingReadOnly* aTiming)
|
||||
: AnimationEffectReadOnly(aDocument)
|
||||
, mTarget(aTarget)
|
||||
, mTiming(aTiming)
|
||||
, mPseudoType(aPseudoType)
|
||||
, mInEffectOnLastAnimationTimingUpdate(false)
|
||||
{
|
||||
MOZ_ASSERT(aTiming);
|
||||
MOZ_ASSERT(aTarget, "null animation target is not yet supported");
|
||||
}
|
||||
|
||||
JSObject*
|
||||
@@ -162,7 +157,8 @@ KeyframeEffectReadOnly::NotifyAnimationTimingUpdated()
|
||||
bool inEffect = IsInEffect();
|
||||
if (inEffect != mInEffectOnLastAnimationTimingUpdate) {
|
||||
if (mTarget) {
|
||||
EffectSet* effectSet = EffectSet::GetEffectSet(mTarget, mPseudoType);
|
||||
EffectSet* effectSet = EffectSet::GetEffectSet(mTarget->mElement,
|
||||
mTarget->mPseudoType);
|
||||
if (effectSet) {
|
||||
effectSet->MarkCascadeNeedsUpdate();
|
||||
}
|
||||
@@ -188,12 +184,7 @@ KeyframeEffectReadOnly::NotifyAnimationTimingUpdated()
|
||||
CanThrottle() ?
|
||||
EffectCompositor::RestyleType::Throttled :
|
||||
EffectCompositor::RestyleType::Standard;
|
||||
nsPresContext* presContext = GetPresContext();
|
||||
if (presContext) {
|
||||
presContext->EffectCompositor()->
|
||||
RequestRestyle(mTarget, mPseudoType, restyleType,
|
||||
mAnimation->CascadeLevel());
|
||||
}
|
||||
RequestRestyle(restyleType);
|
||||
|
||||
// If we're not relevant, we will have been removed from the EffectSet.
|
||||
// As a result, when the restyle we requested above is fulfilled, our
|
||||
@@ -460,10 +451,11 @@ KeyframeEffectReadOnly::SetFrames(JSContext* aContext,
|
||||
nsIPresShell* shell = doc->GetShell();
|
||||
if (shell && mTarget) {
|
||||
nsIAtom* pseudo =
|
||||
mPseudoType < CSSPseudoElementType::Count ?
|
||||
nsCSSPseudoElements::GetPseudoAtom(mPseudoType) : nullptr;
|
||||
mTarget->mPseudoType < CSSPseudoElementType::Count ?
|
||||
nsCSSPseudoElements::GetPseudoAtom(mTarget->mPseudoType) : nullptr;
|
||||
styleContext =
|
||||
nsComputedDOMStyle::GetStyleContextForElement(mTarget, pseudo, shell);
|
||||
nsComputedDOMStyle::GetStyleContextForElement(mTarget->mElement,
|
||||
pseudo, shell);
|
||||
}
|
||||
|
||||
SetFrames(Move(keyframes), styleContext);
|
||||
@@ -527,8 +519,8 @@ KeyframeEffectReadOnly::UpdateProperties(nsStyleContext* aStyleContext)
|
||||
if (mTarget) {
|
||||
properties =
|
||||
KeyframeUtils::GetAnimationPropertiesFromKeyframes(aStyleContext,
|
||||
mTarget,
|
||||
mPseudoType,
|
||||
mTarget->mElement,
|
||||
mTarget->mPseudoType,
|
||||
mFrames);
|
||||
}
|
||||
|
||||
@@ -559,20 +551,13 @@ KeyframeEffectReadOnly::UpdateProperties(nsStyleContext* aStyleContext)
|
||||
}
|
||||
|
||||
if (mTarget) {
|
||||
EffectSet* effectSet = EffectSet::GetEffectSet(mTarget, mPseudoType);
|
||||
EffectSet* effectSet = EffectSet::GetEffectSet(mTarget->mElement,
|
||||
mTarget->mPseudoType);
|
||||
if (effectSet) {
|
||||
effectSet->MarkCascadeNeedsUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
if (mAnimation) {
|
||||
nsPresContext* presContext = GetPresContext();
|
||||
if (presContext) {
|
||||
presContext->EffectCompositor()->
|
||||
RequestRestyle(mTarget, mPseudoType,
|
||||
EffectCompositor::RestyleType::Layer,
|
||||
mAnimation->CascadeLevel());
|
||||
}
|
||||
RequestRestyle(EffectCompositor::RestyleType::Layer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -716,6 +701,29 @@ KeyframeEffectReadOnly::~KeyframeEffectReadOnly()
|
||||
{
|
||||
}
|
||||
|
||||
static Maybe<OwningAnimationTarget>
|
||||
ConvertTarget(const Nullable<ElementOrCSSPseudoElement>& aTarget)
|
||||
{
|
||||
// Return value optimization.
|
||||
Maybe<OwningAnimationTarget> result;
|
||||
|
||||
if (aTarget.IsNull()) {
|
||||
return result;
|
||||
}
|
||||
|
||||
const ElementOrCSSPseudoElement& target = aTarget.Value();
|
||||
MOZ_ASSERT(target.IsElement() || target.IsCSSPseudoElement(),
|
||||
"Uninitialized target");
|
||||
|
||||
if (target.IsElement()) {
|
||||
result.emplace(&target.GetAsElement());
|
||||
} else {
|
||||
RefPtr<Element> elem = target.GetAsCSSPseudoElement().ParentElement();
|
||||
result.emplace(elem, target.GetAsCSSPseudoElement().GetType());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
template <class KeyframeEffectType, class OptionsType>
|
||||
/* static */ already_AddRefed<KeyframeEffectType>
|
||||
KeyframeEffectReadOnly::ConstructKeyframeEffect(
|
||||
@@ -737,28 +745,10 @@ KeyframeEffectReadOnly::ConstructKeyframeEffect(
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (aTarget.IsNull()) {
|
||||
// We don't support null targets yet.
|
||||
aRv.Throw(NS_ERROR_DOM_ANIM_NO_TARGET_ERR);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const ElementOrCSSPseudoElement& target = aTarget.Value();
|
||||
MOZ_ASSERT(target.IsElement() || target.IsCSSPseudoElement(),
|
||||
"Uninitialized target");
|
||||
|
||||
RefPtr<Element> targetElement;
|
||||
CSSPseudoElementType pseudoType = CSSPseudoElementType::NotPseudo;
|
||||
if (target.IsElement()) {
|
||||
targetElement = &target.GetAsElement();
|
||||
} else {
|
||||
targetElement = target.GetAsCSSPseudoElement().ParentElement();
|
||||
pseudoType = target.GetAsCSSPseudoElement().GetType();
|
||||
}
|
||||
|
||||
Maybe<OwningAnimationTarget> target = ConvertTarget(aTarget);
|
||||
RefPtr<KeyframeEffectType> effect =
|
||||
new KeyframeEffectType(targetElement->OwnerDoc(), targetElement,
|
||||
pseudoType, timingParams);
|
||||
new KeyframeEffectType(doc, target, timingParams);
|
||||
|
||||
effect->SetFrames(aGlobal.Context(), aFrames, aRv);
|
||||
if (aRv.Failed()) {
|
||||
return nullptr;
|
||||
@@ -775,6 +765,14 @@ KeyframeEffectReadOnly::ResetIsRunningOnCompositor()
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
KeyframeEffectReadOnly::ResetWinsInCascade()
|
||||
{
|
||||
for (AnimationProperty& property : mProperties) {
|
||||
property.mWinsInCascade = false;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
KeyframeEffectReadOnly::UpdateTargetRegistration()
|
||||
{
|
||||
@@ -792,20 +790,39 @@ KeyframeEffectReadOnly::UpdateTargetRegistration()
|
||||
"Out of date Animation::IsRelevant value");
|
||||
|
||||
if (isRelevant) {
|
||||
EffectSet* effectSet = EffectSet::GetOrCreateEffectSet(mTarget,
|
||||
mPseudoType);
|
||||
EffectSet* effectSet =
|
||||
EffectSet::GetOrCreateEffectSet(mTarget->mElement, mTarget->mPseudoType);
|
||||
effectSet->AddEffect(*this);
|
||||
} else {
|
||||
EffectSet* effectSet = EffectSet::GetEffectSet(mTarget, mPseudoType);
|
||||
if (effectSet) {
|
||||
effectSet->RemoveEffect(*this);
|
||||
if (effectSet->IsEmpty()) {
|
||||
EffectSet::DestroyEffectSet(mTarget, mPseudoType);
|
||||
}
|
||||
UnregisterTarget();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
KeyframeEffectReadOnly::UnregisterTarget()
|
||||
{
|
||||
EffectSet* effectSet =
|
||||
EffectSet::GetEffectSet(mTarget->mElement, mTarget->mPseudoType);
|
||||
if (effectSet) {
|
||||
effectSet->RemoveEffect(*this);
|
||||
if (effectSet->IsEmpty()) {
|
||||
EffectSet::DestroyEffectSet(mTarget->mElement, mTarget->mPseudoType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
KeyframeEffectReadOnly::RequestRestyle(
|
||||
EffectCompositor::RestyleType aRestyleType)
|
||||
{
|
||||
nsPresContext* presContext = GetPresContext();
|
||||
if (presContext && mTarget && mAnimation) {
|
||||
presContext->EffectCompositor()->
|
||||
RequestRestyle(mTarget->mElement, mTarget->mPseudoType,
|
||||
aRestyleType, mAnimation->CascadeLevel());
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
void
|
||||
DumpAnimationProperties(nsTArray<AnimationProperty>& aAnimationProperties)
|
||||
@@ -859,15 +876,16 @@ KeyframeEffectReadOnly::GetTarget(
|
||||
return;
|
||||
}
|
||||
|
||||
switch (mPseudoType) {
|
||||
switch (mTarget->mPseudoType) {
|
||||
case CSSPseudoElementType::before:
|
||||
case CSSPseudoElementType::after:
|
||||
aRv.SetValue().SetAsCSSPseudoElement() =
|
||||
CSSPseudoElement::GetCSSPseudoElement(mTarget, mPseudoType);
|
||||
CSSPseudoElement::GetCSSPseudoElement(mTarget->mElement,
|
||||
mTarget->mPseudoType);
|
||||
break;
|
||||
|
||||
case CSSPseudoElementType::NotPseudo:
|
||||
aRv.SetValue().SetAsElement() = mTarget;
|
||||
aRv.SetValue().SetAsElement() = mTarget->mElement;
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -1073,7 +1091,8 @@ KeyframeEffectReadOnly::CanThrottle() const
|
||||
continue;
|
||||
}
|
||||
|
||||
EffectSet* effectSet = EffectSet::GetEffectSet(mTarget, mPseudoType);
|
||||
EffectSet* effectSet = EffectSet::GetEffectSet(mTarget->mElement,
|
||||
mTarget->mPseudoType);
|
||||
MOZ_ASSERT(effectSet, "CanThrottle should be called on an effect "
|
||||
"associated with a target element");
|
||||
layers::Layer* layer =
|
||||
@@ -1121,7 +1140,8 @@ KeyframeEffectReadOnly::CanThrottleTransformChanges(nsIFrame& aFrame) const
|
||||
TimeStamp now =
|
||||
presContext->RefreshDriver()->MostRecentRefresh();
|
||||
|
||||
EffectSet* effectSet = EffectSet::GetEffectSet(mTarget, mPseudoType);
|
||||
EffectSet* effectSet = EffectSet::GetEffectSet(mTarget->mElement,
|
||||
mTarget->mPseudoType);
|
||||
MOZ_ASSERT(effectSet, "CanThrottleTransformChanges is expected to be called"
|
||||
" on an effect in an effect set");
|
||||
MOZ_ASSERT(mAnimation, "CanThrottleTransformChanges is expected to be called"
|
||||
@@ -1159,18 +1179,18 @@ KeyframeEffectReadOnly::GetAnimationFrame() const
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsIFrame* frame = mTarget->GetPrimaryFrame();
|
||||
nsIFrame* frame = mTarget->mElement->GetPrimaryFrame();
|
||||
if (!frame) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (mPseudoType == CSSPseudoElementType::before) {
|
||||
if (mTarget->mPseudoType == CSSPseudoElementType::before) {
|
||||
frame = nsLayoutUtils::GetBeforeFrame(frame);
|
||||
} else if (mPseudoType == CSSPseudoElementType::after) {
|
||||
} else if (mTarget->mPseudoType == CSSPseudoElementType::after) {
|
||||
frame = nsLayoutUtils::GetAfterFrame(frame);
|
||||
} else {
|
||||
MOZ_ASSERT(mPseudoType == CSSPseudoElementType::NotPseudo,
|
||||
"unknown mPseudoType");
|
||||
MOZ_ASSERT(mTarget->mPseudoType == CSSPseudoElementType::NotPseudo,
|
||||
"unknown mTarget->mPseudoType");
|
||||
}
|
||||
if (!frame) {
|
||||
return nullptr;
|
||||
@@ -1185,7 +1205,7 @@ KeyframeEffectReadOnly::GetRenderedDocument() const
|
||||
if (!mTarget) {
|
||||
return nullptr;
|
||||
}
|
||||
return mTarget->GetComposedDoc();
|
||||
return mTarget->mElement->GetComposedDoc();
|
||||
}
|
||||
|
||||
nsPresContext*
|
||||
@@ -1303,7 +1323,7 @@ KeyframeEffectReadOnly::SetPerformanceWarning(
|
||||
if (nsLayoutUtils::IsAnimationLoggingEnabled() &&
|
||||
property.mPerformanceWarning->ToLocalizedString(localizedString)) {
|
||||
nsAutoCString logMessage = NS_ConvertUTF16toUTF8(localizedString);
|
||||
AnimationUtils::LogAsyncAnimationFailure(logMessage, mTarget);
|
||||
AnimationUtils::LogAsyncAnimationFailure(logMessage, mTarget->mElement);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -1317,10 +1337,9 @@ KeyframeEffectReadOnly::SetPerformanceWarning(
|
||||
//---------------------------------------------------------------------
|
||||
|
||||
KeyframeEffect::KeyframeEffect(nsIDocument* aDocument,
|
||||
Element* aTarget,
|
||||
CSSPseudoElementType aPseudoType,
|
||||
const Maybe<OwningAnimationTarget>& aTarget,
|
||||
const TimingParams& aTiming)
|
||||
: KeyframeEffectReadOnly(aDocument, aTarget, aPseudoType,
|
||||
: KeyframeEffectReadOnly(aDocument, aTarget,
|
||||
new AnimationEffectTiming(aDocument, aTiming, this))
|
||||
{
|
||||
}
|
||||
@@ -1356,10 +1375,13 @@ KeyframeEffect::Constructor(
|
||||
aOptions, aRv);
|
||||
}
|
||||
|
||||
void KeyframeEffect::NotifySpecifiedTimingUpdated()
|
||||
void
|
||||
KeyframeEffect::NotifySpecifiedTimingUpdated()
|
||||
{
|
||||
// Use the same document for a pseudo element and its parent element.
|
||||
nsAutoAnimationMutationBatch mb(mTarget->OwnerDoc());
|
||||
// Use nullptr if we don't have mTarget, so disable the mutation batch.
|
||||
nsAutoAnimationMutationBatch mb(mTarget ? mTarget->mElement->OwnerDoc()
|
||||
: nullptr);
|
||||
|
||||
if (mAnimation) {
|
||||
mAnimation->NotifyEffectTimingUpdated();
|
||||
@@ -1368,12 +1390,43 @@ void KeyframeEffect::NotifySpecifiedTimingUpdated()
|
||||
nsNodeUtils::AnimationChanged(mAnimation);
|
||||
}
|
||||
|
||||
nsPresContext* presContext = GetPresContext();
|
||||
if (presContext) {
|
||||
presContext->EffectCompositor()->
|
||||
RequestRestyle(mTarget, mPseudoType,
|
||||
EffectCompositor::RestyleType::Layer,
|
||||
mAnimation->CascadeLevel());
|
||||
RequestRestyle(EffectCompositor::RestyleType::Layer);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
KeyframeEffect::SetTarget(const Nullable<ElementOrCSSPseudoElement>& aTarget)
|
||||
{
|
||||
Maybe<OwningAnimationTarget> newTarget = ConvertTarget(aTarget);
|
||||
if (mTarget == newTarget) {
|
||||
// Assign the same target, skip it.
|
||||
return;
|
||||
}
|
||||
|
||||
if (mTarget) {
|
||||
UnregisterTarget();
|
||||
ResetIsRunningOnCompositor();
|
||||
ResetWinsInCascade();
|
||||
|
||||
RequestRestyle(EffectCompositor::RestyleType::Layer);
|
||||
|
||||
nsAutoAnimationMutationBatch mb(mTarget->mElement->OwnerDoc());
|
||||
if (mAnimation) {
|
||||
nsNodeUtils::AnimationRemoved(mAnimation);
|
||||
}
|
||||
}
|
||||
|
||||
mTarget = newTarget;
|
||||
|
||||
if (mTarget) {
|
||||
UpdateTargetRegistration();
|
||||
MaybeUpdateProperties();
|
||||
|
||||
RequestRestyle(EffectCompositor::RestyleType::Layer);
|
||||
|
||||
nsAutoAnimationMutationBatch mb(mTarget->mElement->OwnerDoc());
|
||||
if (mAnimation) {
|
||||
nsNodeUtils::AnimationAdded(mAnimation);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1387,5 +1440,30 @@ KeyframeEffect::~KeyframeEffect()
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
KeyframeEffect::MaybeUpdateProperties()
|
||||
{
|
||||
if (!mTarget) {
|
||||
return;
|
||||
}
|
||||
|
||||
nsIDocument* doc = mTarget->mElement->OwnerDoc();
|
||||
if (!doc) {
|
||||
return;
|
||||
}
|
||||
|
||||
nsIAtom* pseudo = mTarget->mPseudoType < CSSPseudoElementType::Count ?
|
||||
nsCSSPseudoElements::GetPseudoAtom(mTarget->mPseudoType) :
|
||||
nullptr;
|
||||
RefPtr<nsStyleContext> styleContext =
|
||||
nsComputedDOMStyle::GetStyleContextForElement(mTarget->mElement, pseudo,
|
||||
doc->GetShell());
|
||||
if (!styleContext) {
|
||||
return;
|
||||
}
|
||||
|
||||
UpdateProperties(styleContext);
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
@@ -15,12 +15,13 @@
|
||||
#include "nsTArray.h"
|
||||
#include "nsWrapperCache.h"
|
||||
#include "mozilla/AnimationPerformanceWarning.h"
|
||||
#include "mozilla/AnimationTarget.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/ComputedTiming.h"
|
||||
#include "mozilla/ComputedTimingFunction.h"
|
||||
#include "mozilla/EffectCompositor.h"
|
||||
#include "mozilla/LayerAnimationInfo.h" // LayerAnimations::kRecords
|
||||
#include "mozilla/Maybe.h"
|
||||
#include "mozilla/NonOwningAnimationTarget.h"
|
||||
#include "mozilla/OwningNonNull.h" // OwningNonNull<...>
|
||||
#include "mozilla/StickyTimeDuration.h"
|
||||
#include "mozilla/StyleAnimationValue.h"
|
||||
@@ -191,8 +192,7 @@ class KeyframeEffectReadOnly : public AnimationEffectReadOnly
|
||||
{
|
||||
public:
|
||||
KeyframeEffectReadOnly(nsIDocument* aDocument,
|
||||
Element* aTarget,
|
||||
CSSPseudoElementType aPseudoType,
|
||||
const Maybe<OwningAnimationTarget>& aTarget,
|
||||
const TimingParams& aTiming);
|
||||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
@@ -221,7 +221,7 @@ public:
|
||||
{
|
||||
Maybe<NonOwningAnimationTarget> result;
|
||||
if (mTarget) {
|
||||
result.emplace(mTarget, mPseudoType);
|
||||
result.emplace(*mTarget);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -338,8 +338,7 @@ public:
|
||||
|
||||
protected:
|
||||
KeyframeEffectReadOnly(nsIDocument* aDocument,
|
||||
Element* aTarget,
|
||||
CSSPseudoElementType aPseudoType,
|
||||
const Maybe<OwningAnimationTarget>& aTarget,
|
||||
AnimationEffectTimingReadOnly* aTiming);
|
||||
|
||||
virtual ~KeyframeEffectReadOnly();
|
||||
@@ -353,6 +352,7 @@ protected:
|
||||
ErrorResult& aRv);
|
||||
|
||||
void ResetIsRunningOnCompositor();
|
||||
void ResetWinsInCascade();
|
||||
|
||||
// This effect is registered with its target element so long as:
|
||||
//
|
||||
@@ -365,11 +365,15 @@ protected:
|
||||
// owning Animation's timing.
|
||||
void UpdateTargetRegistration();
|
||||
|
||||
nsCOMPtr<Element> mTarget;
|
||||
// Remove the current effect target from its EffectSet.
|
||||
void UnregisterTarget();
|
||||
|
||||
void RequestRestyle(EffectCompositor::RestyleType aRestyleType);
|
||||
|
||||
Maybe<OwningAnimationTarget> mTarget;
|
||||
RefPtr<Animation> mAnimation;
|
||||
|
||||
RefPtr<AnimationEffectTimingReadOnly> mTiming;
|
||||
CSSPseudoElementType mPseudoType;
|
||||
|
||||
// The specified keyframes.
|
||||
nsTArray<Keyframe> mFrames;
|
||||
@@ -407,8 +411,7 @@ class KeyframeEffect : public KeyframeEffectReadOnly
|
||||
{
|
||||
public:
|
||||
KeyframeEffect(nsIDocument* aDocument,
|
||||
Element* aTarget,
|
||||
CSSPseudoElementType aPseudoType,
|
||||
const Maybe<OwningAnimationTarget>& aTarget,
|
||||
const TimingParams& aTiming);
|
||||
|
||||
JSObject* WrapObject(JSContext* aCx,
|
||||
@@ -433,8 +436,21 @@ public:
|
||||
|
||||
void NotifySpecifiedTimingUpdated();
|
||||
|
||||
// This method calls MaybeUpdateProperties which is not safe to use when
|
||||
// we are in the middle of updating style. If we need to use this when
|
||||
// updating style, we should pass the nsStyleContext into this method and use
|
||||
// that to update the properties rather than calling
|
||||
// GetStyleContextForElement.
|
||||
void SetTarget(const Nullable<ElementOrCSSPseudoElement>& aTarget);
|
||||
|
||||
protected:
|
||||
~KeyframeEffect() override;
|
||||
|
||||
// We need to be careful to *not* call this when we are updating the style
|
||||
// context. That's because calling GetStyleContextForElement when we are in
|
||||
// the process of building a style context may trigger various forms of
|
||||
// infinite recursion.
|
||||
void MaybeUpdateProperties();
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* 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/. */
|
||||
|
||||
#ifndef mozilla_NonOwningAnimationTarget_h
|
||||
#define mozilla_NonOwningAnimationTarget_h
|
||||
|
||||
#include "mozilla/Attributes.h" // For MOZ_NON_OWNING_REF
|
||||
#include "nsCSSPseudoElements.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
namespace dom {
|
||||
class Element;
|
||||
} // namespace dom
|
||||
|
||||
struct NonOwningAnimationTarget
|
||||
{
|
||||
NonOwningAnimationTarget(dom::Element* aElement, CSSPseudoElementType aType)
|
||||
: mElement(aElement), mPseudoType(aType) { }
|
||||
|
||||
// mElement represents the parent element of a pseudo-element, not the
|
||||
// generated content element.
|
||||
dom::Element* MOZ_NON_OWNING_REF mElement = nullptr;
|
||||
CSSPseudoElementType mPseudoType = CSSPseudoElementType::NotPseudo;
|
||||
};
|
||||
|
||||
} // namespace mozilla
|
||||
|
||||
#endif // mozilla_NonOwningAnimationTarget_h
|
||||
@@ -8,8 +8,8 @@
|
||||
#define mozilla_PseudoElementHashEntry_h
|
||||
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/AnimationTarget.h"
|
||||
#include "mozilla/HashFunctions.h"
|
||||
#include "mozilla/NonOwningAnimationTarget.h"
|
||||
#include "PLDHashTable.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
@@ -21,6 +21,7 @@ EXPORTS.mozilla.dom += [
|
||||
EXPORTS.mozilla += [
|
||||
'AnimationComparator.h',
|
||||
'AnimationPerformanceWarning.h',
|
||||
'AnimationTarget.h',
|
||||
'AnimationUtils.h',
|
||||
'AnimValuesStyleRule.h',
|
||||
'ComputedTiming.h',
|
||||
@@ -28,7 +29,6 @@ EXPORTS.mozilla += [
|
||||
'EffectCompositor.h',
|
||||
'EffectSet.h',
|
||||
'KeyframeUtils.h',
|
||||
'NonOwningAnimationTarget.h',
|
||||
'PendingAnimationTracker.h',
|
||||
'PseudoElementHashEntry.h',
|
||||
'TimingParams.h',
|
||||
|
||||
@@ -2105,6 +2105,81 @@ addAsyncAnimTest("exclude_animations_targeting_pseudo_elements",
|
||||
"records after animation is finished");
|
||||
});
|
||||
|
||||
addAsyncAnimTest("create_animation_without_target",
|
||||
{ observe: document, subtree: true }, function*() {
|
||||
var effect = new KeyframeEffectReadOnly(null,
|
||||
{ opacity: [ 0, 1 ] },
|
||||
{ duration: 10000 });
|
||||
var anim = new Animation(effect, document.timeline);
|
||||
anim.play();
|
||||
yield await_frame();
|
||||
assert_records([], "no records after animation is added");
|
||||
|
||||
anim.cancel();
|
||||
yield await_frame();
|
||||
assert_records([], "no records after animation is removed");
|
||||
});
|
||||
|
||||
addAsyncAnimTest("set_animation_target",
|
||||
{ observe: document, subtree: true }, function*() {
|
||||
var anim = div.animate({ opacity: [ 0, 1 ] },
|
||||
{ duration: 100 * MS_PER_SEC });
|
||||
|
||||
yield await_frame();
|
||||
assert_records([{ added: [anim], changed: [], removed: [] }],
|
||||
"records after animation is added");
|
||||
|
||||
anim.effect.target = null;
|
||||
yield await_frame();
|
||||
assert_records([{ added: [], changed: [], removed: [anim] }],
|
||||
"records after setting null");
|
||||
|
||||
anim.effect.target = div;
|
||||
yield await_frame();
|
||||
assert_records([{ added: [anim], changed: [], removed: [] }],
|
||||
"records after setting a target");
|
||||
|
||||
var newTarget = document.createElement("div");
|
||||
document.body.appendChild(newTarget);
|
||||
anim.effect.target = newTarget;
|
||||
yield await_frame();
|
||||
assert_records([{ added: [], changed: [], removed: [anim] },
|
||||
{ added: [anim], changed: [], removed: [] }],
|
||||
"records after setting a different target");
|
||||
|
||||
anim.cancel();
|
||||
yield await_frame();
|
||||
assert_records([{ added: [], changed: [], removed: [anim] }],
|
||||
"records after animation ends");
|
||||
|
||||
newTarget.remove();
|
||||
});
|
||||
|
||||
addAsyncAnimTest("set_redundant_animation_target",
|
||||
{ observe: div, subtree: true }, function*() {
|
||||
var anim = div.animate({ opacity: [ 0, 1 ] },
|
||||
{ duration: 100 * MS_PER_SEC });
|
||||
yield await_frame();
|
||||
assert_records([{ added: [anim], changed: [], removed: [] }],
|
||||
"records after animation is added");
|
||||
|
||||
anim.effect.target = div;
|
||||
yield await_frame();
|
||||
assert_records([], "no records after setting the same target");
|
||||
|
||||
anim.effect.target = null;
|
||||
yield await_frame();
|
||||
assert_records([{ added: [], changed: [], removed: [anim] }],
|
||||
"records after setting null");
|
||||
|
||||
anim.effect.target = null;
|
||||
yield await_frame();
|
||||
assert_records([], "records after setting redundant null");
|
||||
|
||||
anim.cancel();
|
||||
yield await_frame();
|
||||
});
|
||||
|
||||
// Run the tests.
|
||||
SimpleTest.requestLongerTimeout(2);
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
@@ -3,35 +3,29 @@
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||
*/
|
||||
|
||||
var archiveReaderEnabled = false;
|
||||
|
||||
var testGenerator = testSteps();
|
||||
var testGenerator;
|
||||
|
||||
function runTest()
|
||||
{
|
||||
enableArchiveReader();
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
testGenerator.next();
|
||||
|
||||
SpecialPowers.pushPrefEnv({'set': [ ["dom.archivereader.enabled", true] ]}, function() {
|
||||
SpecialPowers.createFiles(filesToCreate(),
|
||||
function (files) {
|
||||
testGenerator = testSteps(files);
|
||||
return testGenerator.next();
|
||||
},
|
||||
function (msg) {
|
||||
ok(false, "File creation error: " + msg);
|
||||
finishTest();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function finishTest()
|
||||
{
|
||||
resetArchiveReader();
|
||||
|
||||
SimpleTest.executeSoon(function() {
|
||||
SpecialPowers.popPrefEnv(function() {
|
||||
testGenerator.close();
|
||||
SimpleTest.finish();
|
||||
});
|
||||
}
|
||||
|
||||
function enableArchiveReader()
|
||||
{
|
||||
archiveReaderEnabled = SpecialPowers.getBoolPref("dom.archivereader.enabled");
|
||||
SpecialPowers.setBoolPref("dom.archivereader.enabled", true);
|
||||
}
|
||||
|
||||
function resetArchiveReader()
|
||||
{
|
||||
SpecialPowers.setBoolPref("dom.archivereader.enabled", archiveReaderEnabled);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
[DEFAULT]
|
||||
skip-if = e10s
|
||||
support-files =
|
||||
helpers.js
|
||||
|
||||
|
||||
@@ -10,57 +10,7 @@
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
|
||||
<script type="text/javascript;version=1.7">
|
||||
function createZipFileWithData(fileData) {
|
||||
var Cc = SpecialPowers.Cc;
|
||||
var Ci = SpecialPowers.Ci;
|
||||
|
||||
var dirSvc = Cc["@mozilla.org/file/directory_service;1"].getService(Ci.nsIProperties);
|
||||
var testFile = dirSvc.get("ProfD", Ci.nsIFile);
|
||||
testFile.append("fileArchiveReader.zip");
|
||||
var outStream = Cc["@mozilla.org/network/file-output-stream;1"].createInstance(Ci.nsIFileOutputStream);
|
||||
outStream.init(testFile, 0x02 | 0x08 | 0x20, // write, create, truncate
|
||||
0666, 0);
|
||||
outStream.write(fileData, fileData.length);
|
||||
outStream.close();
|
||||
|
||||
var fileList = document.getElementById('fileList');
|
||||
SpecialPowers.wrap(fileList).value = testFile.path;
|
||||
|
||||
return fileList.files[0];
|
||||
}
|
||||
|
||||
function createTextFileWithData(fileData) {
|
||||
var Cc = SpecialPowers.Cc;
|
||||
var Ci = SpecialPowers.Ci;
|
||||
|
||||
var dirSvc = Cc["@mozilla.org/file/directory_service;1"].getService(Ci.nsIProperties);
|
||||
var testFile = dirSvc.get("ProfD", Ci.nsIFile);
|
||||
testFile.append("fileArchiveReader.txt");
|
||||
var outStream = Cc["@mozilla.org/network/file-output-stream;1"].createInstance(Ci.nsIFileOutputStream);
|
||||
outStream.init(testFile, 0x02 | 0x08 | 0x20, // write, create, truncate
|
||||
0666, 0);
|
||||
outStream.write(fileData, fileData.length);
|
||||
outStream.close();
|
||||
|
||||
var fileList = document.getElementById('fileList');
|
||||
SpecialPowers.wrap(fileList).value = testFile.path;
|
||||
|
||||
return fileList.files[0];
|
||||
}
|
||||
|
||||
handleFinished = 0;
|
||||
function markTestDone() {
|
||||
++handleFinished;
|
||||
if (isFinished()) {
|
||||
finishTest();
|
||||
}
|
||||
}
|
||||
function isFinished() {
|
||||
return handleFinished == 6;
|
||||
}
|
||||
|
||||
function testSteps()
|
||||
{
|
||||
function filesToCreate() {
|
||||
var binaryString = '504B03040A00000000002E6BF14000000000000000000000000005001C00746573742F555409000337CA055039CA055075780B' +
|
||||
'000104E803000004E8030000504B03041400000008002D6BF1401780E15015000000580200000A001C00746573742F612E7478' +
|
||||
'74555409000336CA05503ACA055075780B000104E803000004E8030000CB48CDC9C95728CF2FCA49E1CA18658FB2A9C4060050' +
|
||||
@@ -78,8 +28,25 @@
|
||||
binaryData += String.fromCharCode(parseInt(hex,16));
|
||||
}
|
||||
|
||||
var binaryFile = createZipFileWithData(binaryData);
|
||||
var textFile = createTextFileWithData("Hello World");
|
||||
return [ {name: "fileArchiveReader.zip", data: binaryData},
|
||||
{name: "fileArchiveReader.txt", data: "Hello World"}];
|
||||
}
|
||||
|
||||
handleFinished = 0;
|
||||
function markTestDone() {
|
||||
++handleFinished;
|
||||
if (isFinished()) {
|
||||
finishTest();
|
||||
}
|
||||
}
|
||||
function isFinished() {
|
||||
return handleFinished == 6;
|
||||
}
|
||||
|
||||
function testSteps(files)
|
||||
{
|
||||
var binaryFile = files[0];
|
||||
var textFile = files[1];
|
||||
|
||||
var status;
|
||||
|
||||
@@ -254,7 +221,6 @@
|
||||
|
||||
<body onload="runTest();">
|
||||
<p id="display">
|
||||
<input id="fileList" type="file"></input>
|
||||
</p>
|
||||
</body>
|
||||
|
||||
|
||||
@@ -10,35 +10,17 @@
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
|
||||
<script type="text/javascript;version=1.7">
|
||||
function createNonUnicodeData() {
|
||||
const Cc = SpecialPowers.Cc;
|
||||
const Ci = SpecialPowers.Ci;
|
||||
|
||||
var dirSvc = Cc["@mozilla.org/file/directory_service;1"].getService(Ci.nsIProperties);
|
||||
var testFile = dirSvc.get("ProfD", Ci.nsIFile);
|
||||
testFile.append("fileArchiveReader_nonUnicode.zip");
|
||||
var outStream = Cc["@mozilla.org/network/file-output-stream;1"].createInstance(Ci.nsIFileOutputStream);
|
||||
outStream.init(testFile, 0x02 | 0x08 | 0x20, // write, create, truncate
|
||||
0666, 0);
|
||||
|
||||
function filesToCreate() {
|
||||
var binaryData = "";
|
||||
for (var i = 0, len = binaryString.length / 2; i < len; ++i) {
|
||||
var hex = binaryString[i * 2] + binaryString[i * 2 + 1];
|
||||
binaryData += String.fromCharCode(parseInt(hex,16));
|
||||
}
|
||||
outStream.write(binaryData, binaryData.length);
|
||||
outStream.close();
|
||||
|
||||
var fileList = document.getElementById('fileList');
|
||||
SpecialPowers.wrap(fileList).value = testFile.path;
|
||||
|
||||
return fileList.files[0];
|
||||
return [ {name: "fileArchiveReader_nonUnicode.zip", data: binaryData} ];
|
||||
}
|
||||
|
||||
function test1()
|
||||
function test1(binaryFile)
|
||||
{
|
||||
var binaryFile = createNonUnicodeData();
|
||||
|
||||
var r = new ArchiveReader(binaryFile, { encoding: "ISO-8859-1" });
|
||||
isnot(r, null, "ArchiveReader cannot be null");
|
||||
|
||||
@@ -51,26 +33,24 @@
|
||||
is(this.result.length, 1, "ArchiveReader.getFilenames(): the array contains 1 item");
|
||||
ok(this.reader, r, "ArchiveRequest.reader should be == ArchiveReader");
|
||||
dump('Content: ' + this.result[0] + '\n');
|
||||
test2();
|
||||
test2(binaryFile);
|
||||
}
|
||||
}
|
||||
|
||||
function test2()
|
||||
function test2(binaryFile)
|
||||
{
|
||||
var binaryFile = createNonUnicodeData();
|
||||
|
||||
try {
|
||||
new ArchiveReader(binaryFile, { encoding: "random stuff" });
|
||||
ok(false, "Should have thrown for bogus encoding label.");
|
||||
} catch (e) {
|
||||
ok(e instanceof RangeError, "Expected a RangeError");
|
||||
finishTest();
|
||||
}
|
||||
finishTest();
|
||||
}
|
||||
|
||||
function testSteps()
|
||||
function testSteps(files)
|
||||
{
|
||||
test1();
|
||||
test1(files[0]);
|
||||
yield undefined;
|
||||
}
|
||||
|
||||
@@ -82,7 +62,6 @@
|
||||
|
||||
<body onload="runTest();">
|
||||
<p id="display">
|
||||
<input id="fileList" type="file"></input>
|
||||
</p>
|
||||
<script type="text/javascript;version=1.7">
|
||||
var binaryString = '' +
|
||||
|
||||
@@ -10,34 +10,18 @@
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
|
||||
<script type="text/javascript;version=1.7">
|
||||
function createZipInZipData() {
|
||||
var Cc = SpecialPowers.Cc;
|
||||
var Ci = SpecialPowers.Ci;
|
||||
|
||||
var dirSvc = Cc["@mozilla.org/file/directory_service;1"].getService(Ci.nsIProperties);
|
||||
var testFile = dirSvc.get("ProfD", Ci.nsIFile);
|
||||
testFile.append("fileArchiveReader_42.zip");
|
||||
var outStream = Cc["@mozilla.org/network/file-output-stream;1"].createInstance(Ci.nsIFileOutputStream);
|
||||
outStream.init(testFile, 0x02 | 0x08 | 0x20, // write, create, truncate
|
||||
0666, 0);
|
||||
|
||||
function filesToCreate() {
|
||||
var binaryData = "";
|
||||
for (var i = 0, len = binaryString.length / 2; i < len; ++i) {
|
||||
var hex = binaryString[i * 2] + binaryString[i * 2 + 1];
|
||||
binaryData += String.fromCharCode(parseInt(hex,16));
|
||||
}
|
||||
outStream.write(binaryData, binaryData.length);
|
||||
outStream.close();
|
||||
|
||||
var fileList = document.getElementById('fileList');
|
||||
SpecialPowers.wrap(fileList).value = testFile.path;
|
||||
|
||||
return fileList.files[0];
|
||||
return [ {name: "fileArchiveReader_42.zip", data: binaryData} ];
|
||||
}
|
||||
|
||||
function testSteps()
|
||||
function testSteps(files)
|
||||
{
|
||||
var binaryFile = createZipInZipData();
|
||||
var binaryFile = files[0];
|
||||
|
||||
// The input is 4 nested zip archives:
|
||||
doLoop(binaryFile, 4);
|
||||
@@ -96,7 +80,6 @@
|
||||
|
||||
<body onload="runTest();">
|
||||
<p id="display">
|
||||
<input id="fileList" type="file"></input>
|
||||
</p>
|
||||
<script type="text/javascript;version=1.7">
|
||||
var binaryString = '' +
|
||||
|
||||
@@ -218,7 +218,6 @@ Attr::GetSpecified(bool* aSpecified)
|
||||
Element*
|
||||
Attr::GetOwnerElement(ErrorResult& aRv)
|
||||
{
|
||||
OwnerDoc()->WarnOnceAbout(nsIDocument::eOwnerElement);
|
||||
return GetElement();
|
||||
}
|
||||
|
||||
@@ -226,7 +225,6 @@ NS_IMETHODIMP
|
||||
Attr::GetOwnerElement(nsIDOMElement** aOwnerElement)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aOwnerElement);
|
||||
OwnerDoc()->WarnOnceAbout(nsIDocument::eOwnerElement);
|
||||
|
||||
Element* element = GetElement();
|
||||
if (element) {
|
||||
|
||||
+14
-12
@@ -96,6 +96,7 @@ public:
|
||||
, mIDType(eUnknown)
|
||||
, mOuterIDNumber(0)
|
||||
, mInnerIDNumber(0)
|
||||
, mStatus(eUnused)
|
||||
#ifdef DEBUG
|
||||
, mOwningThread(PR_GetCurrentThread())
|
||||
#endif
|
||||
@@ -1048,7 +1049,6 @@ void
|
||||
Console::Trace(JSContext* aCx)
|
||||
{
|
||||
AssertIsOnOwningThread();
|
||||
MOZ_ASSERT(mStatus == eInitialized);
|
||||
|
||||
const Sequence<JS::Value> data;
|
||||
Method(aCx, MethodTrace, NS_LITERAL_STRING("trace"), data);
|
||||
@@ -1066,7 +1066,6 @@ void
|
||||
Console::Time(JSContext* aCx, const JS::Handle<JS::Value> aTime)
|
||||
{
|
||||
AssertIsOnOwningThread();
|
||||
MOZ_ASSERT(mStatus == eInitialized);
|
||||
|
||||
Sequence<JS::Value> data;
|
||||
SequenceRooter<JS::Value> rooter(aCx, &data);
|
||||
@@ -1082,7 +1081,6 @@ void
|
||||
Console::TimeEnd(JSContext* aCx, const JS::Handle<JS::Value> aTime)
|
||||
{
|
||||
AssertIsOnOwningThread();
|
||||
MOZ_ASSERT(mStatus == eInitialized);
|
||||
|
||||
Sequence<JS::Value> data;
|
||||
SequenceRooter<JS::Value> rooter(aCx, &data);
|
||||
@@ -1098,7 +1096,6 @@ void
|
||||
Console::TimeStamp(JSContext* aCx, const JS::Handle<JS::Value> aData)
|
||||
{
|
||||
AssertIsOnOwningThread();
|
||||
MOZ_ASSERT(mStatus == eInitialized);
|
||||
|
||||
Sequence<JS::Value> data;
|
||||
SequenceRooter<JS::Value> rooter(aCx, &data);
|
||||
@@ -1114,8 +1111,6 @@ void
|
||||
Console::Profile(JSContext* aCx, const Sequence<JS::Value>& aData)
|
||||
{
|
||||
AssertIsOnOwningThread();
|
||||
MOZ_ASSERT(mStatus == eInitialized);
|
||||
|
||||
ProfileMethod(aCx, NS_LITERAL_STRING("profile"), aData);
|
||||
}
|
||||
|
||||
@@ -1123,8 +1118,6 @@ void
|
||||
Console::ProfileEnd(JSContext* aCx, const Sequence<JS::Value>& aData)
|
||||
{
|
||||
AssertIsOnOwningThread();
|
||||
MOZ_ASSERT(mStatus == eInitialized);
|
||||
|
||||
ProfileMethod(aCx, NS_LITERAL_STRING("profileEnd"), aData);
|
||||
}
|
||||
|
||||
@@ -1132,7 +1125,9 @@ void
|
||||
Console::ProfileMethod(JSContext* aCx, const nsAString& aAction,
|
||||
const Sequence<JS::Value>& aData)
|
||||
{
|
||||
MOZ_ASSERT(mStatus == eInitialized);
|
||||
if (IsShuttingDown()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!NS_IsMainThread()) {
|
||||
// Here we are in a worker thread.
|
||||
@@ -1190,7 +1185,6 @@ Console::Assert(JSContext* aCx, bool aCondition,
|
||||
const Sequence<JS::Value>& aData)
|
||||
{
|
||||
AssertIsOnOwningThread();
|
||||
MOZ_ASSERT(mStatus == eInitialized);
|
||||
|
||||
if (!aCondition) {
|
||||
Method(aCx, MethodAssert, NS_LITERAL_STRING("assert"), aData);
|
||||
@@ -1203,7 +1197,6 @@ void
|
||||
Console::NoopMethod()
|
||||
{
|
||||
AssertIsOnOwningThread();
|
||||
MOZ_ASSERT(mStatus == eInitialized);
|
||||
|
||||
// Nothing to do.
|
||||
}
|
||||
@@ -1277,7 +1270,9 @@ Console::Method(JSContext* aCx, MethodName aMethodName,
|
||||
const Sequence<JS::Value>& aData)
|
||||
{
|
||||
AssertIsOnOwningThread();
|
||||
MOZ_ASSERT(mStatus == eInitialized);
|
||||
if (IsShuttingDown()) {
|
||||
return;
|
||||
}
|
||||
|
||||
RefPtr<ConsoleCallData> callData(new ConsoleCallData());
|
||||
|
||||
@@ -2410,5 +2405,12 @@ Console::AssertIsOnOwningThread() const
|
||||
MOZ_ASSERT(PR_GetCurrentThread() == mOwningThread);
|
||||
}
|
||||
|
||||
bool
|
||||
Console::IsShuttingDown() const
|
||||
{
|
||||
MOZ_ASSERT(mStatus != eUnknown);
|
||||
return mStatus == eShuttingDown;
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
+4
-2
@@ -36,8 +36,6 @@ class Console final : public nsIObserver
|
||||
, public nsWrapperCache
|
||||
, public nsSupportsWeakReference
|
||||
{
|
||||
~Console();
|
||||
|
||||
public:
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(Console, nsIObserver)
|
||||
@@ -133,6 +131,7 @@ public:
|
||||
|
||||
private:
|
||||
explicit Console(nsPIDOMWindowInner* aWindow);
|
||||
~Console();
|
||||
|
||||
void
|
||||
Initialize(ErrorResult& aRv);
|
||||
@@ -343,6 +342,9 @@ private:
|
||||
void
|
||||
AssertIsOnOwningThread() const;
|
||||
|
||||
bool
|
||||
IsShuttingDown() const;
|
||||
|
||||
// All these nsCOMPtr are touched on main thread only.
|
||||
nsCOMPtr<nsPIDOMWindowInner> mWindow;
|
||||
nsCOMPtr<nsIConsoleAPIStorage> mStorage;
|
||||
|
||||
@@ -185,7 +185,7 @@ EventSource::Init(nsISupports* aOwner,
|
||||
const nsAString& aURL,
|
||||
bool aWithCredentials)
|
||||
{
|
||||
if (mReadyState != CONNECTING || !PrefEnabled()) {
|
||||
if (mReadyState != CONNECTING) {
|
||||
return NS_ERROR_DOM_SECURITY_ERR;
|
||||
}
|
||||
|
||||
@@ -572,13 +572,6 @@ EventSource::GetInterface(const nsIID & aIID,
|
||||
return QueryInterface(aIID, aResult);
|
||||
}
|
||||
|
||||
// static
|
||||
bool
|
||||
EventSource::PrefEnabled(JSContext* aCx, JSObject* aGlobal)
|
||||
{
|
||||
return Preferences::GetBool("dom.server-events.enabled", false);
|
||||
}
|
||||
|
||||
nsresult
|
||||
EventSource::GetBaseURI(nsIURI **aBaseURI)
|
||||
{
|
||||
|
||||
@@ -93,9 +93,6 @@ public:
|
||||
IMPL_EVENT_HANDLER(error)
|
||||
void Close();
|
||||
|
||||
// Determine if preferences allow EventSource
|
||||
static bool PrefEnabled(JSContext* aCx = nullptr, JSObject* aGlobal = nullptr);
|
||||
|
||||
virtual void DisconnectFromOwner() override;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -337,7 +337,14 @@ URLSearchParams::Constructor(const GlobalObject& aGlobal,
|
||||
{
|
||||
RefPtr<URLSearchParams> sp =
|
||||
new URLSearchParams(aGlobal.GetAsSupports(), nullptr);
|
||||
sp->ParseInput(NS_ConvertUTF16toUTF8(aInit));
|
||||
|
||||
NS_ConvertUTF16toUTF8 input(aInit);
|
||||
|
||||
if (StringBeginsWith(input, NS_LITERAL_CSTRING("?"))) {
|
||||
sp->ParseInput(Substring(input, 1, input.Length() - 1));
|
||||
} else {
|
||||
sp->ParseInput(input);
|
||||
}
|
||||
|
||||
return sp.forget();
|
||||
}
|
||||
|
||||
@@ -294,13 +294,27 @@ WindowNamedPropertiesHandler::Create(JSContext* aCx,
|
||||
// Note: since the scope polluter proxy lives on the window's prototype
|
||||
// chain, it needs a singleton type to avoid polluting type information
|
||||
// for properties on the window.
|
||||
JS::Rooted<JSObject*> gsp(aCx);
|
||||
js::ProxyOptions options;
|
||||
options.setSingleton(true);
|
||||
options.setClass(&WindowNamedPropertiesClass.mBase);
|
||||
return js::NewProxyObject(aCx, WindowNamedPropertiesHandler::getInstance(),
|
||||
JS::NullHandleValue, aProto,
|
||||
options);
|
||||
|
||||
JS::Rooted<JSObject*> gsp(aCx);
|
||||
gsp = js::NewProxyObject(aCx, WindowNamedPropertiesHandler::getInstance(),
|
||||
JS::NullHandleValue, aProto,
|
||||
options);
|
||||
if (!gsp) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool succeeded;
|
||||
if (!JS_SetImmutablePrototype(aCx, gsp, &succeeded)) {
|
||||
return nullptr;
|
||||
}
|
||||
MOZ_ASSERT(succeeded,
|
||||
"errors making the [[Prototype]] of the named properties object "
|
||||
"immutable should have been JSAPI failures, not !succeeded");
|
||||
|
||||
return gsp;
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
|
||||
@@ -83,7 +83,7 @@ ContentAreaDropListener.prototype =
|
||||
|
||||
// Use file:/// as the default uri so that drops of file URIs are always allowed
|
||||
let principal = sourceNode ? sourceNode.nodePrincipal
|
||||
: secMan.getSimpleCodebasePrincipal(ioService.newURI("file:///", null, null));
|
||||
: secMan.createCodebasePrincipal(ioService.newURI("file:///", null, null), {});
|
||||
|
||||
secMan.checkLoadURIStrWithPrincipal(principal, uriString, flags);
|
||||
|
||||
|
||||
@@ -118,7 +118,6 @@ DOM4_MSG_DEF(BtAuthRejectedError, "Authentication rejected", NS_ERROR_DOM_BLUET
|
||||
/* Web Animations errors */
|
||||
|
||||
DOM4_MSG_DEF(NotSupportedError, "Animation to or from an underlying value is not yet supported.", NS_ERROR_DOM_ANIM_MISSING_PROPS_ERR)
|
||||
DOM4_MSG_DEF(NotSupportedError, "Animation with no target is not yet supported.", NS_ERROR_DOM_ANIM_NO_TARGET_ERR)
|
||||
DOM4_MSG_DEF(NotSupportedError, "Animation with no timeline is not yet supported.", NS_ERROR_DOM_ANIM_NO_TIMELINE_ERR)
|
||||
DOM4_MSG_DEF(NotSupportedError, "Animation with no effect is not yet supported.", NS_ERROR_DOM_ANIM_NO_EFFECT_ERR)
|
||||
|
||||
|
||||
@@ -381,12 +381,12 @@ nsAttrAndChildArray::AttrAt(uint32_t aPos) const
|
||||
NS_ASSERTION(aPos < AttrCount(),
|
||||
"out-of-bounds access in nsAttrAndChildArray");
|
||||
|
||||
uint32_t mapped = MappedAttrCount();
|
||||
if (aPos < mapped) {
|
||||
return mImpl->mMappedAttrs->AttrAt(aPos);
|
||||
uint32_t nonmapped = NonMappedAttrCount();
|
||||
if (aPos < nonmapped) {
|
||||
return &ATTRS(mImpl)[aPos].mValue;
|
||||
}
|
||||
|
||||
return &ATTRS(mImpl)[aPos - mapped].mValue;
|
||||
return mImpl->mMappedAttrs->AttrAt(aPos - nonmapped);
|
||||
}
|
||||
|
||||
nsresult
|
||||
@@ -454,36 +454,35 @@ nsAttrAndChildArray::RemoveAttrAt(uint32_t aPos, nsAttrValue& aValue)
|
||||
{
|
||||
NS_ASSERTION(aPos < AttrCount(), "out-of-bounds");
|
||||
|
||||
uint32_t mapped = MappedAttrCount();
|
||||
if (aPos < mapped) {
|
||||
if (mapped == 1) {
|
||||
// We're removing the last mapped attribute. Can't swap in this
|
||||
// case; have to copy.
|
||||
aValue.SetTo(*mImpl->mMappedAttrs->AttrAt(0));
|
||||
NS_RELEASE(mImpl->mMappedAttrs);
|
||||
uint32_t nonmapped = NonMappedAttrCount();
|
||||
if (aPos < nonmapped) {
|
||||
ATTRS(mImpl)[aPos].mValue.SwapValueWith(aValue);
|
||||
ATTRS(mImpl)[aPos].~InternalAttr();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
uint32_t slotCount = AttrSlotCount();
|
||||
memmove(&ATTRS(mImpl)[aPos],
|
||||
&ATTRS(mImpl)[aPos + 1],
|
||||
(slotCount - aPos - 1) * sizeof(InternalAttr));
|
||||
memset(&ATTRS(mImpl)[slotCount - 1], 0, sizeof(InternalAttr));
|
||||
|
||||
RefPtr<nsMappedAttributes> mapped =
|
||||
GetModifiableMapped(nullptr, nullptr, false);
|
||||
|
||||
mapped->RemoveAttrAt(aPos, aValue);
|
||||
|
||||
return MakeMappedUnique(mapped);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
aPos -= mapped;
|
||||
ATTRS(mImpl)[aPos].mValue.SwapValueWith(aValue);
|
||||
ATTRS(mImpl)[aPos].~InternalAttr();
|
||||
if (MappedAttrCount() == 1) {
|
||||
// We're removing the last mapped attribute. Can't swap in this
|
||||
// case; have to copy.
|
||||
aValue.SetTo(*mImpl->mMappedAttrs->AttrAt(0));
|
||||
NS_RELEASE(mImpl->mMappedAttrs);
|
||||
|
||||
uint32_t slotCount = AttrSlotCount();
|
||||
memmove(&ATTRS(mImpl)[aPos],
|
||||
&ATTRS(mImpl)[aPos + 1],
|
||||
(slotCount - aPos - 1) * sizeof(InternalAttr));
|
||||
memset(&ATTRS(mImpl)[slotCount - 1], 0, sizeof(InternalAttr));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
RefPtr<nsMappedAttributes> mapped =
|
||||
GetModifiableMapped(nullptr, nullptr, false);
|
||||
|
||||
mapped->RemoveAttrAt(aPos - nonmapped, aValue);
|
||||
|
||||
return MakeMappedUnique(mapped);
|
||||
}
|
||||
|
||||
const nsAttrName*
|
||||
@@ -492,33 +491,32 @@ nsAttrAndChildArray::AttrNameAt(uint32_t aPos) const
|
||||
NS_ASSERTION(aPos < AttrCount(),
|
||||
"out-of-bounds access in nsAttrAndChildArray");
|
||||
|
||||
uint32_t mapped = MappedAttrCount();
|
||||
if (aPos < mapped) {
|
||||
return mImpl->mMappedAttrs->NameAt(aPos);
|
||||
uint32_t nonmapped = NonMappedAttrCount();
|
||||
if (aPos < nonmapped) {
|
||||
return &ATTRS(mImpl)[aPos].mName;
|
||||
}
|
||||
|
||||
return &ATTRS(mImpl)[aPos - mapped].mName;
|
||||
return mImpl->mMappedAttrs->NameAt(aPos - nonmapped);
|
||||
}
|
||||
|
||||
const nsAttrName*
|
||||
nsAttrAndChildArray::GetSafeAttrNameAt(uint32_t aPos) const
|
||||
{
|
||||
uint32_t mapped = MappedAttrCount();
|
||||
if (aPos < mapped) {
|
||||
return mImpl->mMappedAttrs->NameAt(aPos);
|
||||
uint32_t nonmapped = NonMappedAttrCount();
|
||||
if (aPos < nonmapped) {
|
||||
void** pos = mImpl->mBuffer + aPos * ATTRSIZE;
|
||||
if (!*pos) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return &reinterpret_cast<InternalAttr*>(pos)->mName;
|
||||
}
|
||||
|
||||
aPos -= mapped;
|
||||
if (aPos >= AttrSlotCount()) {
|
||||
if (aPos >= AttrCount()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void** pos = mImpl->mBuffer + aPos * ATTRSIZE;
|
||||
if (!*pos) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return &reinterpret_cast<InternalAttr*>(pos)->mName;
|
||||
return mImpl->mMappedAttrs->NameAt(aPos - nonmapped);
|
||||
}
|
||||
|
||||
const nsAttrName*
|
||||
@@ -545,25 +543,24 @@ nsAttrAndChildArray::IndexOfAttr(nsIAtom* aLocalName, int32_t aNamespaceID) cons
|
||||
if (mImpl && mImpl->mMappedAttrs && aNamespaceID == kNameSpaceID_None) {
|
||||
idx = mImpl->mMappedAttrs->IndexOfAttr(aLocalName);
|
||||
if (idx >= 0) {
|
||||
return idx;
|
||||
return NonMappedAttrCount() + idx;
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t i;
|
||||
uint32_t mapped = MappedAttrCount();
|
||||
uint32_t slotCount = AttrSlotCount();
|
||||
if (aNamespaceID == kNameSpaceID_None) {
|
||||
// This should be the common case so lets make an optimized loop
|
||||
for (i = 0; i < slotCount && AttrSlotIsTaken(i); ++i) {
|
||||
if (ATTRS(mImpl)[i].mName.Equals(aLocalName)) {
|
||||
return i + mapped;
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (i = 0; i < slotCount && AttrSlotIsTaken(i); ++i) {
|
||||
if (ATTRS(mImpl)[i].mName.Equals(aLocalName, aNamespaceID)) {
|
||||
return i + mapped;
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+29
-24
@@ -7400,27 +7400,32 @@ nsContentUtils::TransferableToIPCTransferable(nsITransferable* aTransferable,
|
||||
RefPtr<mozilla::gfx::SourceSurface> surface =
|
||||
image->GetFrame(imgIContainer::FRAME_CURRENT,
|
||||
imgIContainer::FLAG_SYNC_DECODE);
|
||||
if (surface) {
|
||||
RefPtr<mozilla::gfx::DataSourceSurface> dataSurface =
|
||||
surface->GetDataSurface();
|
||||
size_t length;
|
||||
int32_t stride;
|
||||
mozilla::UniquePtr<char[]> surfaceData =
|
||||
nsContentUtils::GetSurfaceData(dataSurface, &length, &stride);
|
||||
|
||||
IPCDataTransferItem* item = aIPCDataTransfer->items().AppendElement();
|
||||
item->flavor() = flavorStr;
|
||||
// Turn item->data() into an nsCString prior to accessing it.
|
||||
item->data() = EmptyCString();
|
||||
item->data().get_nsCString().Adopt(surfaceData.release(), length);
|
||||
|
||||
IPCDataTransferImage& imageDetails = item->imageDetails();
|
||||
mozilla::gfx::IntSize size = dataSurface->GetSize();
|
||||
imageDetails.width() = size.width;
|
||||
imageDetails.height() = size.height;
|
||||
imageDetails.stride() = stride;
|
||||
imageDetails.format() = static_cast<uint8_t>(dataSurface->GetFormat());
|
||||
if (!surface) {
|
||||
continue;
|
||||
}
|
||||
RefPtr<mozilla::gfx::DataSourceSurface> dataSurface =
|
||||
surface->GetDataSurface();
|
||||
if (!dataSurface) {
|
||||
continue;
|
||||
}
|
||||
size_t length;
|
||||
int32_t stride;
|
||||
mozilla::UniquePtr<char[]> surfaceData =
|
||||
nsContentUtils::GetSurfaceData(WrapNotNull(dataSurface), &length,
|
||||
&stride);
|
||||
|
||||
IPCDataTransferItem* item = aIPCDataTransfer->items().AppendElement();
|
||||
item->flavor() = flavorStr;
|
||||
// Turn item->data() into an nsCString prior to accessing it.
|
||||
item->data() = EmptyCString();
|
||||
item->data().get_nsCString().Adopt(surfaceData.release(), length);
|
||||
|
||||
IPCDataTransferImage& imageDetails = item->imageDetails();
|
||||
mozilla::gfx::IntSize size = dataSurface->GetSize();
|
||||
imageDetails.width() = size.width;
|
||||
imageDetails.height() = size.height;
|
||||
imageDetails.stride() = stride;
|
||||
imageDetails.format() = static_cast<uint8_t>(dataSurface->GetFormat());
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -7511,8 +7516,9 @@ nsContentUtils::TransferableToIPCTransferable(nsITransferable* aTransferable,
|
||||
}
|
||||
|
||||
mozilla::UniquePtr<char[]>
|
||||
nsContentUtils::GetSurfaceData(mozilla::gfx::DataSourceSurface* aSurface,
|
||||
size_t* aLength, int32_t* aStride)
|
||||
nsContentUtils::GetSurfaceData(
|
||||
NotNull<mozilla::gfx::DataSourceSurface*> aSurface,
|
||||
size_t* aLength, int32_t* aStride)
|
||||
{
|
||||
mozilla::gfx::DataSourceSurface::MappedSurface map;
|
||||
if (NS_WARN_IF(!aSurface->Map(mozilla::gfx::DataSourceSurface::MapType::READ, &map))) {
|
||||
@@ -8580,8 +8586,7 @@ StartElement(Element* aContent, StringBuilder& aBuilder)
|
||||
}
|
||||
|
||||
int32_t count = aContent->GetAttrCount();
|
||||
for (int32_t i = count; i > 0;) {
|
||||
--i;
|
||||
for (int32_t i = 0; i < count; i++) {
|
||||
const nsAttrName* name = aContent->GetAttrNameAt(i);
|
||||
int32_t attNs = name->NamespaceID();
|
||||
nsIAtom* attName = name->LocalName();
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "mozilla/FloatingPoint.h"
|
||||
#include "mozilla/net/ReferrerPolicy.h"
|
||||
#include "mozilla/Logging.h"
|
||||
#include "mozilla/NotNull.h"
|
||||
#include "nsIContentPolicy.h"
|
||||
|
||||
#if defined(XP_WIN)
|
||||
@@ -2425,8 +2426,9 @@ public:
|
||||
* Get the pixel data from the given source surface and return it as a buffer.
|
||||
* The length and stride will be assigned from the surface.
|
||||
*/
|
||||
static mozilla::UniquePtr<char[]> GetSurfaceData(mozilla::gfx::DataSourceSurface* aSurface,
|
||||
size_t* aLength, int32_t* aStride);
|
||||
static mozilla::UniquePtr<char[]> GetSurfaceData(
|
||||
mozilla::NotNull<mozilla::gfx::DataSourceSurface*> aSurface,
|
||||
size_t* aLength, int32_t* aStride);
|
||||
|
||||
// Helpers shared by the implementations of nsContentUtils methods and
|
||||
// nsIDOMWindowUtils methods.
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
#include "nsIScriptObjectPrincipal.h"
|
||||
#include "nsProxyRelease.h"
|
||||
|
||||
#include "DataChannel.h"
|
||||
#include "DataChannelLog.h"
|
||||
@@ -44,7 +45,7 @@ nsDOMDataChannel::~nsDOMDataChannel()
|
||||
// Don't call us anymore! Likely isn't an issue (or maybe just less of
|
||||
// one) once we block GC until all the (appropriate) onXxxx handlers
|
||||
// are dropped. (See WebRTC spec)
|
||||
LOG(("Close()ing %p", mDataChannel.get()));
|
||||
LOG(("%p: Close()ing %p", this, mDataChannel.get()));
|
||||
mDataChannel->SetListener(nullptr, nullptr);
|
||||
mDataChannel->Close();
|
||||
}
|
||||
@@ -77,6 +78,8 @@ nsDOMDataChannel::nsDOMDataChannel(already_AddRefed<mozilla::DataChannel>& aData
|
||||
: DOMEventTargetHelper(aWindow)
|
||||
, mDataChannel(aDataChannel)
|
||||
, mBinaryType(DC_BINARY_TYPE_BLOB)
|
||||
, mCheckMustKeepAlive(true)
|
||||
, mSentClose(false)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -263,6 +266,7 @@ NS_IMETHODIMP
|
||||
nsDOMDataChannel::Close()
|
||||
{
|
||||
mDataChannel->Close();
|
||||
UpdateMustKeepAlive();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@@ -471,9 +475,20 @@ nsDOMDataChannel::OnChannelConnected(nsISupports* aContext)
|
||||
nsresult
|
||||
nsDOMDataChannel::OnChannelClosed(nsISupports* aContext)
|
||||
{
|
||||
LOG(("%p(%p): %s - Dispatching\n",this,(void*)mDataChannel,__FUNCTION__));
|
||||
nsresult rv;
|
||||
// so we don't have to worry if we're notified from different paths in
|
||||
// the underlying code
|
||||
if (!mSentClose) {
|
||||
LOG(("%p(%p): %s - Dispatching\n",this,(void*)mDataChannel,__FUNCTION__));
|
||||
|
||||
return OnSimpleEvent(aContext, NS_LITERAL_STRING("close"));
|
||||
rv = OnSimpleEvent(aContext, NS_LITERAL_STRING("close"));
|
||||
// no more events can happen
|
||||
mSentClose = true;
|
||||
} else {
|
||||
rv = NS_OK;
|
||||
}
|
||||
DontKeepAliveAnyMore();
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsresult
|
||||
@@ -484,12 +499,111 @@ nsDOMDataChannel::OnBufferLow(nsISupports* aContext)
|
||||
return OnSimpleEvent(aContext, NS_LITERAL_STRING("bufferedamountlow"));
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsDOMDataChannel::NotBuffered(nsISupports* aContext)
|
||||
{
|
||||
// In the rare case that we held off GC to let the buffer drain
|
||||
UpdateMustKeepAlive();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
nsDOMDataChannel::AppReady()
|
||||
{
|
||||
mDataChannel->AppReady();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Methods that keep alive the DataChannel object when:
|
||||
// 1. the object has registered event listeners that can be triggered
|
||||
// ("strong event listeners");
|
||||
// 2. there are outgoing not sent messages.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void
|
||||
nsDOMDataChannel::UpdateMustKeepAlive()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
if (!mCheckMustKeepAlive) {
|
||||
return;
|
||||
}
|
||||
|
||||
bool shouldKeepAlive = false;
|
||||
uint16_t readyState = mDataChannel->GetReadyState();
|
||||
|
||||
switch (readyState)
|
||||
{
|
||||
case DataChannel::CONNECTING:
|
||||
case DataChannel::WAITING_TO_OPEN:
|
||||
{
|
||||
if (mListenerManager &&
|
||||
(mListenerManager->HasListenersFor(nsGkAtoms::onopen) ||
|
||||
mListenerManager->HasListenersFor(nsGkAtoms::onmessage) ||
|
||||
mListenerManager->HasListenersFor(nsGkAtoms::onerror) ||
|
||||
mListenerManager->HasListenersFor(nsGkAtoms::onbufferedamountlow) ||
|
||||
mListenerManager->HasListenersFor(nsGkAtoms::onclose))) {
|
||||
shouldKeepAlive = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case DataChannel::OPEN:
|
||||
case DataChannel::CLOSING:
|
||||
{
|
||||
if (mDataChannel->GetBufferedAmount() != 0 ||
|
||||
(mListenerManager &&
|
||||
(mListenerManager->HasListenersFor(nsGkAtoms::onmessage) ||
|
||||
mListenerManager->HasListenersFor(nsGkAtoms::onerror) ||
|
||||
mListenerManager->HasListenersFor(nsGkAtoms::onbufferedamountlow) ||
|
||||
mListenerManager->HasListenersFor(nsGkAtoms::onclose)))) {
|
||||
shouldKeepAlive = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case DataChannel::CLOSED:
|
||||
{
|
||||
shouldKeepAlive = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (mSelfRef && !shouldKeepAlive) {
|
||||
// release our self-reference (safely) by putting it in an event (always)
|
||||
NS_ReleaseOnMainThread(mSelfRef.forget(), true);
|
||||
} else if (!mSelfRef && shouldKeepAlive) {
|
||||
mSelfRef = this;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsDOMDataChannel::DontKeepAliveAnyMore()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
if (mSelfRef) {
|
||||
// Since we're on MainThread, force an eventloop trip to avoid deleting ourselves.
|
||||
NS_ReleaseOnMainThread(mSelfRef.forget(), true);
|
||||
}
|
||||
|
||||
mCheckMustKeepAlive = false;
|
||||
}
|
||||
|
||||
void
|
||||
nsDOMDataChannel::EventListenerAdded(nsIAtom* aType)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
UpdateMustKeepAlive();
|
||||
}
|
||||
|
||||
void
|
||||
nsDOMDataChannel::EventListenerRemoved(nsIAtom* aType)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
UpdateMustKeepAlive();
|
||||
}
|
||||
|
||||
|
||||
/* static */
|
||||
nsresult
|
||||
NS_NewDOMDataChannel(already_AddRefed<mozilla::DataChannel>&& aDataChannel,
|
||||
|
||||
@@ -42,6 +42,10 @@ public:
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsDOMDataChannel,
|
||||
mozilla::DOMEventTargetHelper)
|
||||
|
||||
// EventTarget
|
||||
virtual void EventListenerAdded(nsIAtom* aType) override;
|
||||
virtual void EventListenerRemoved(nsIAtom* aType) override;
|
||||
|
||||
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
|
||||
override;
|
||||
nsPIDOMWindowInner* GetParentObject() const
|
||||
@@ -103,9 +107,20 @@ public:
|
||||
virtual nsresult
|
||||
OnBufferLow(nsISupports* aContext) override;
|
||||
|
||||
virtual nsresult
|
||||
NotBuffered(nsISupports* aContext) override;
|
||||
|
||||
virtual void
|
||||
AppReady();
|
||||
|
||||
// if there are "strong event listeners" or outgoing not sent messages
|
||||
// then this method keeps the object alive when js doesn't have strong
|
||||
// references to it.
|
||||
void UpdateMustKeepAlive();
|
||||
// ATTENTION, when calling this method the object can be released
|
||||
// (and possibly collected).
|
||||
void DontKeepAliveAnyMore();
|
||||
|
||||
protected:
|
||||
~nsDOMDataChannel();
|
||||
|
||||
@@ -113,6 +128,8 @@ private:
|
||||
void Send(nsIInputStream* aMsgStream, const nsACString& aMsgString,
|
||||
uint32_t aMsgLength, bool aIsBinary, mozilla::ErrorResult& aRv);
|
||||
|
||||
// to keep us alive while we have listeners
|
||||
RefPtr<nsDOMDataChannel> mSelfRef;
|
||||
// Owning reference
|
||||
RefPtr<mozilla::DataChannel> mDataChannel;
|
||||
nsString mOrigin;
|
||||
@@ -121,6 +138,8 @@ private:
|
||||
DC_BINARY_TYPE_BLOB,
|
||||
};
|
||||
DataChannelBinaryType mBinaryType;
|
||||
bool mCheckMustKeepAlive;
|
||||
bool mSentClose;
|
||||
};
|
||||
|
||||
#endif // nsDOMDataChannel_h
|
||||
|
||||
@@ -74,7 +74,7 @@ nsDOMTokenList::IndexedGetter(uint32_t aIndex, bool& aFound, nsAString& aResult)
|
||||
}
|
||||
|
||||
void
|
||||
nsDOMTokenList::SetValue(const nsAString& aValue, mozilla::ErrorResult& rv)
|
||||
nsDOMTokenList::SetValue(const nsAString& aValue, ErrorResult& rv)
|
||||
{
|
||||
if (!mElement) {
|
||||
return;
|
||||
@@ -182,7 +182,7 @@ nsDOMTokenList::Add(const nsTArray<nsString>& aTokens, ErrorResult& aError)
|
||||
}
|
||||
|
||||
void
|
||||
nsDOMTokenList::Add(const nsAString& aToken, mozilla::ErrorResult& aError)
|
||||
nsDOMTokenList::Add(const nsAString& aToken, ErrorResult& aError)
|
||||
{
|
||||
AutoTArray<nsString, 1> tokens;
|
||||
tokens.AppendElement(aToken);
|
||||
@@ -268,7 +268,7 @@ nsDOMTokenList::Remove(const nsTArray<nsString>& aTokens, ErrorResult& aError)
|
||||
}
|
||||
|
||||
void
|
||||
nsDOMTokenList::Remove(const nsAString& aToken, mozilla::ErrorResult& aError)
|
||||
nsDOMTokenList::Remove(const nsAString& aToken, ErrorResult& aError)
|
||||
{
|
||||
AutoTArray<nsString, 1> tokens;
|
||||
tokens.AppendElement(aToken);
|
||||
@@ -308,6 +308,43 @@ nsDOMTokenList::Toggle(const nsAString& aToken,
|
||||
return isPresent;
|
||||
}
|
||||
|
||||
void
|
||||
nsDOMTokenList::Replace(const nsAString& aToken,
|
||||
const nsAString& aNewToken,
|
||||
ErrorResult& aError)
|
||||
{
|
||||
// Doing this here instead of using `CheckToken` because if aToken had invalid
|
||||
// characters, and aNewToken is empty, the returned error should be a
|
||||
// SyntaxError, not an InvalidCharacterError.
|
||||
if (aNewToken.IsEmpty()) {
|
||||
aError.Throw(NS_ERROR_DOM_SYNTAX_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
aError = CheckToken(aToken);
|
||||
if (aError.Failed()) {
|
||||
return;
|
||||
}
|
||||
|
||||
aError = CheckToken(aNewToken);
|
||||
if (aError.Failed()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const nsAttrValue* attr = GetParsedAttr();
|
||||
if (!attr || !attr->Contains(aToken)) {
|
||||
return;
|
||||
}
|
||||
|
||||
AutoTArray<nsString, 1> tokens;
|
||||
|
||||
tokens.AppendElement(aToken);
|
||||
RemoveInternal(attr, tokens);
|
||||
|
||||
tokens[0] = aNewToken;
|
||||
AddInternal(attr, tokens);
|
||||
}
|
||||
|
||||
void
|
||||
nsDOMTokenList::Stringify(nsAString& aResult)
|
||||
{
|
||||
|
||||
@@ -63,10 +63,13 @@ public:
|
||||
void Remove(const nsAString& aToken, mozilla::ErrorResult& aError);
|
||||
void Remove(const nsTArray<nsString>& aTokens,
|
||||
mozilla::ErrorResult& aError);
|
||||
void Replace(const nsAString& aToken,
|
||||
const nsAString& aNewToken,
|
||||
mozilla::ErrorResult& aError);
|
||||
bool Toggle(const nsAString& aToken,
|
||||
const mozilla::dom::Optional<bool>& force,
|
||||
mozilla::ErrorResult& aError);
|
||||
|
||||
|
||||
void GetValue(nsAString& aResult) { Stringify(aResult); }
|
||||
void SetValue(const nsAString& aValue, mozilla::ErrorResult& rv);
|
||||
void Stringify(nsAString& aResult);
|
||||
|
||||
@@ -380,9 +380,12 @@ nsDOMWindowUtils::SetDisplayPortForElement(float aXPx, float aYPx,
|
||||
LayerManager* manager = widget->GetLayerManager(&isRetainingManager);
|
||||
if (isRetainingManager) {
|
||||
manager->BeginTransaction();
|
||||
nsLayoutUtils::PaintFrame(nullptr, rootFrame, nsRegion(), NS_RGB(255, 255, 255),
|
||||
nsLayoutUtils::PAINT_WIDGET_LAYERS |
|
||||
nsLayoutUtils::PAINT_EXISTING_TRANSACTION);
|
||||
using PaintFrameFlags = nsLayoutUtils::PaintFrameFlags;
|
||||
nsLayoutUtils::PaintFrame(nullptr, rootFrame, nsRegion(),
|
||||
NS_RGB(255, 255, 255),
|
||||
nsDisplayListBuilderMode::PAINTING,
|
||||
PaintFrameFlags::PAINT_WIDGET_LAYERS |
|
||||
PaintFrameFlags::PAINT_EXISTING_TRANSACTION);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3142,6 +3145,7 @@ LinkedList<OldWindowSize> OldWindowSize::sList;
|
||||
NS_IMETHODIMP
|
||||
nsDOMWindowUtils::HandleFullscreenRequests(bool* aRetVal)
|
||||
{
|
||||
PROFILER_MARKER("Enter fullscreen");
|
||||
nsCOMPtr<nsIDocument> doc = GetDocument();
|
||||
NS_ENSURE_STATE(doc);
|
||||
|
||||
@@ -3164,6 +3168,7 @@ nsDOMWindowUtils::HandleFullscreenRequests(bool* aRetVal)
|
||||
nsresult
|
||||
nsDOMWindowUtils::ExitFullscreen()
|
||||
{
|
||||
PROFILER_MARKER("Exit fullscreen");
|
||||
nsCOMPtr<nsIDocument> doc = GetDocument();
|
||||
NS_ENSURE_STATE(doc);
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@ DEPRECATED_OPERATION(SetAttributeNodeNS)
|
||||
DEPRECATED_OPERATION(RemoveAttributeNode)
|
||||
DEPRECATED_OPERATION(CreateAttribute)
|
||||
DEPRECATED_OPERATION(CreateAttributeNS)
|
||||
DEPRECATED_OPERATION(OwnerElement)
|
||||
DEPRECATED_OPERATION(NodeValue)
|
||||
DEPRECATED_OPERATION(TextContent)
|
||||
DEPRECATED_OPERATION(EnablePrivilege)
|
||||
|
||||
+3
-23
@@ -3574,11 +3574,11 @@ nsIDocument::GetBaseURI(bool aTryUseXHRDocBaseURI) const
|
||||
return uri.forget();
|
||||
}
|
||||
|
||||
nsresult
|
||||
void
|
||||
nsDocument::SetBaseURI(nsIURI* aURI)
|
||||
{
|
||||
if (!aURI && !mDocumentBaseURI) {
|
||||
return NS_OK;
|
||||
return;
|
||||
}
|
||||
|
||||
// Don't do anything if the URI wasn't actually changed.
|
||||
@@ -3586,25 +3586,7 @@ nsDocument::SetBaseURI(nsIURI* aURI)
|
||||
bool equalBases = false;
|
||||
mDocumentBaseURI->Equals(aURI, &equalBases);
|
||||
if (equalBases) {
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if CSP allows this base-uri
|
||||
nsCOMPtr<nsIContentSecurityPolicy> csp;
|
||||
nsresult rv = NodePrincipal()->GetCsp(getter_AddRefs(csp));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
if (csp && aURI) {
|
||||
bool permitsBaseURI = false;
|
||||
|
||||
// base-uri is only enforced if explicitly defined in the
|
||||
// policy - do *not* consult default-src, see:
|
||||
// http://www.w3.org/TR/CSP2/#directive-default-src
|
||||
rv = csp->Permits(aURI, nsIContentSecurityPolicy::BASE_URI_DIRECTIVE,
|
||||
true, &permitsBaseURI);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
if (!permitsBaseURI) {
|
||||
return NS_OK;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3614,8 +3596,6 @@ nsDocument::SetBaseURI(nsIURI* aURI)
|
||||
mDocumentBaseURI = nullptr;
|
||||
}
|
||||
RefreshLinkHrefs();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -735,7 +735,7 @@ public:
|
||||
*/
|
||||
virtual void SetContentType(const nsAString& aContentType) override;
|
||||
|
||||
virtual nsresult SetBaseURI(nsIURI* aURI) override;
|
||||
virtual void SetBaseURI(nsIURI* aURI) override;
|
||||
|
||||
/**
|
||||
* Get/Set the base target of a link in a document.
|
||||
|
||||
@@ -6153,6 +6153,27 @@ private:
|
||||
MOZ_COUNT_DTOR(FullscreenTransitionTask);
|
||||
}
|
||||
|
||||
/**
|
||||
* The flow of fullscreen transition:
|
||||
*
|
||||
* parent process | child process
|
||||
* ----------------------------------------------------------------
|
||||
*
|
||||
* | request/exit fullscreen
|
||||
* <-----|
|
||||
* BeforeToggle stage |
|
||||
* |
|
||||
* ToggleFullscreen stage *1 |----->
|
||||
* | HandleFullscreenRequests
|
||||
* |
|
||||
* <-----| MozAfterPaint event
|
||||
* AfterToggle stage *2 |
|
||||
* |
|
||||
* End stage |
|
||||
*
|
||||
* Note we also start a timer at *1 so that if we don't get MozAfterPaint
|
||||
* from the child process in time, we continue going to *2.
|
||||
*/
|
||||
enum Stage {
|
||||
// BeforeToggle stage happens before we enter or leave fullscreen
|
||||
// state. In this stage, the task triggers the pre-toggle fullscreen
|
||||
@@ -6164,7 +6185,9 @@ private:
|
||||
// AfterToggle stage happens after we toggle the fullscreen state.
|
||||
// In this stage, the task triggers the post-toggle fullscreen
|
||||
// transition on the widget.
|
||||
eAfterToggle
|
||||
eAfterToggle,
|
||||
// End stage is triggered after the final transition finishes.
|
||||
eEnd
|
||||
};
|
||||
|
||||
class Observer final : public nsIObserver
|
||||
@@ -6210,10 +6233,12 @@ FullscreenTransitionTask::Run()
|
||||
return NS_OK;
|
||||
}
|
||||
if (stage == eBeforeToggle) {
|
||||
PROFILER_MARKER("Fullscreen transition start");
|
||||
mWidget->PerformFullscreenTransition(nsIWidget::eBeforeFullscreenToggle,
|
||||
mDuration.mFadeIn, mTransitionData,
|
||||
this);
|
||||
} else if (stage == eToggleFullscreen) {
|
||||
PROFILER_MARKER("Fullscreen toggle start");
|
||||
if (MOZ_UNLIKELY(mWindow->mFullScreen != mFullscreen)) {
|
||||
// This could happen in theory if several fullscreen requests in
|
||||
// different direction happen continuously in a short time. We
|
||||
@@ -6253,6 +6278,8 @@ FullscreenTransitionTask::Run()
|
||||
mWidget->PerformFullscreenTransition(nsIWidget::eAfterFullscreenToggle,
|
||||
mDuration.mFadeOut, mTransitionData,
|
||||
this);
|
||||
} else if (stage == eEnd) {
|
||||
PROFILER_MARKER("Fullscreen transition end");
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
@@ -6273,6 +6300,7 @@ FullscreenTransitionTask::Observer::Observe(nsISupports* aSubject,
|
||||
// The paint notification arrives first. Cancel the timer.
|
||||
mTask->mTimer->Cancel();
|
||||
shouldContinue = true;
|
||||
PROFILER_MARKER("Fullscreen toggle end");
|
||||
}
|
||||
} else {
|
||||
#ifdef DEBUG
|
||||
@@ -6283,6 +6311,7 @@ FullscreenTransitionTask::Observer::Observe(nsISupports* aSubject,
|
||||
"Should only trigger this with the timer the task created");
|
||||
#endif
|
||||
shouldContinue = true;
|
||||
PROFILER_MARKER("Fullscreen toggle timeout");
|
||||
}
|
||||
if (shouldContinue) {
|
||||
nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
|
||||
|
||||
@@ -82,8 +82,7 @@ nsHTMLContentSerializer::SerializeHTMLAttributes(nsIContent* aContent,
|
||||
nsAutoString valueStr;
|
||||
NS_NAMED_LITERAL_STRING(_mozStr, "_moz");
|
||||
|
||||
for (int32_t index = count; index > 0;) {
|
||||
--index;
|
||||
for (int32_t index = 0; index < count; index++) {
|
||||
const nsAttrName* name = aContent->GetAttrNameAt(index);
|
||||
int32_t namespaceID = name->NamespaceID();
|
||||
nsIAtom* attrName = name->LocalName();
|
||||
|
||||
+12
-1
@@ -396,7 +396,7 @@ public:
|
||||
}
|
||||
virtual already_AddRefed<nsIURI> GetBaseURI(bool aTryUseXHRDocBaseURI = false) const override;
|
||||
|
||||
virtual nsresult SetBaseURI(nsIURI* aURI) = 0;
|
||||
virtual void SetBaseURI(nsIURI* aURI) = 0;
|
||||
|
||||
/**
|
||||
* Get/Set the base target of a link in a document.
|
||||
@@ -1054,6 +1054,17 @@ public:
|
||||
nsIURI* sheetURI) = 0;
|
||||
virtual mozilla::StyleSheetHandle GetFirstAdditionalAuthorSheet() = 0;
|
||||
|
||||
/**
|
||||
* Assuming that aDocSheets is an array of document-level style
|
||||
* sheets for this document, returns the index that aSheet should
|
||||
* be inserted at to maintain document ordering.
|
||||
*
|
||||
* Defined in nsIDocumentInlines.h.
|
||||
*/
|
||||
template<typename T>
|
||||
size_t FindDocStyleSheetInsertionPoint(const nsTArray<RefPtr<T>>& aDocSheets,
|
||||
T* aSheet);
|
||||
|
||||
/**
|
||||
* Get this document's CSSLoader. This is guaranteed to not return null.
|
||||
*/
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
#include "nsIDocument.h"
|
||||
#include "mozilla/dom/HTMLBodyElement.h"
|
||||
#include "nsStyleSheetService.h"
|
||||
|
||||
inline mozilla::dom::HTMLBodyElement*
|
||||
nsIDocument::GetBodyElement()
|
||||
@@ -15,4 +16,45 @@ nsIDocument::GetBodyElement()
|
||||
return static_cast<mozilla::dom::HTMLBodyElement*>(GetHtmlChildElement(nsGkAtoms::body));
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
size_t
|
||||
nsIDocument::FindDocStyleSheetInsertionPoint(
|
||||
const nsTArray<RefPtr<T>>& aDocSheets,
|
||||
T* aSheet)
|
||||
{
|
||||
nsStyleSheetService* sheetService = nsStyleSheetService::GetInstance();
|
||||
|
||||
// lowest index first
|
||||
int32_t newDocIndex = GetIndexOfStyleSheet(aSheet);
|
||||
|
||||
int32_t count = aDocSheets.Length();
|
||||
int32_t index;
|
||||
for (index = 0; index < count; index++) {
|
||||
T* sheet = aDocSheets[index];
|
||||
int32_t sheetDocIndex = GetIndexOfStyleSheet(sheet);
|
||||
if (sheetDocIndex > newDocIndex)
|
||||
break;
|
||||
|
||||
mozilla::StyleSheetHandle sheetHandle = sheet;
|
||||
|
||||
// If the sheet is not owned by the document it can be an author
|
||||
// sheet registered at nsStyleSheetService or an additional author
|
||||
// sheet on the document, which means the new
|
||||
// doc sheet should end up before it.
|
||||
if (sheetDocIndex < 0) {
|
||||
if (sheetService) {
|
||||
auto& authorSheets = *sheetService->AuthorStyleSheets();
|
||||
if (authorSheets.IndexOf(sheetHandle) != authorSheets.NoIndex) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (sheetHandle == GetFirstAdditionalAuthorSheet()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return size_t(index);
|
||||
}
|
||||
|
||||
#endif // nsIDocumentInlines_h
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#endif
|
||||
#include "nsBindingManager.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "mozilla/AnimationTarget.h"
|
||||
#include "mozilla/Assertions.h"
|
||||
#include "mozilla/dom/Animation.h"
|
||||
#include "mozilla/dom/HTMLImageElement.h"
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
#define nsNodeUtils_h___
|
||||
|
||||
#include "mozilla/Maybe.h"
|
||||
#include "mozilla/NonOwningAnimationTarget.h"
|
||||
#include "nsIContent.h" // for use in inline function (ParentChainChanged)
|
||||
#include "nsIMutationObserver.h" // for use in inline function (ParentChainChanged)
|
||||
#include "js/TypeDecls.h"
|
||||
@@ -18,6 +17,7 @@ struct CharacterDataChangeInfo;
|
||||
template<class E> class nsCOMArray;
|
||||
class nsCycleCollectionTraversalCallback;
|
||||
namespace mozilla {
|
||||
struct NonOwningAnimationTarget;
|
||||
namespace dom {
|
||||
class Animation;
|
||||
} // namespace dom
|
||||
|
||||
@@ -379,7 +379,6 @@ skip-if = toolkit != 'gonk'
|
||||
[test_XHRDocURI.html]
|
||||
[test_XHRResponseURL.html]
|
||||
[test_XHRSendData.html]
|
||||
skip-if = buildapp == 'b2g' || e10s # b2g(seems to stall) b2g-debug(seems to stall) b2g-desktop(seems to stall)
|
||||
[test_XHR_anon.html]
|
||||
[test_XHR_header.html]
|
||||
[test_XHR_onuploadprogress.html]
|
||||
|
||||
@@ -21,9 +21,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=716841
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
function doTest(test_id) {
|
||||
oldPrefVal = SpecialPowers.getBoolPref("dom.server-events.enabled");
|
||||
ok(true, "here we go");
|
||||
|
||||
source = new EventSource("eventsource_redirect.resource");
|
||||
ok(source.url == "http://mochi.test:8888/tests/dom/base/test/eventsource_redirect.resource", "Test failed.");
|
||||
ok(source.readyState == 0 || source.readyState == 1, "Test failed.");
|
||||
@@ -47,9 +44,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=716841
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addLoadEvent(function() {
|
||||
SpecialPowers.pushPrefEnv({"set": [['dom.server-events.enabled', true]]}, doTest);
|
||||
});
|
||||
addLoadEvent(doTest);
|
||||
</script>
|
||||
</pre>
|
||||
|
||||
|
||||
@@ -5,27 +5,48 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=464848
|
||||
-->
|
||||
<head>
|
||||
<title>XMLHttpRequest send data and headers</title>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
<body onload="gen.next();">
|
||||
<body onload="createFiles();">
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=464848">Mozilla Bug 464848</a>
|
||||
<p id="display">
|
||||
<input id="fileList" type="file"></input>
|
||||
</p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="application/javascript;version=1.8">
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
var testData = "blahblahblahblahblahblahblaaaaaaaah. blah.";
|
||||
var extensions = [".txt",".png",".jpg",".gif",".xml", "noext"];
|
||||
var fileTypes = ["text/plain", "image/png", "image/jpeg", "image/gif", "text/xml", null];
|
||||
var gen = runTests();
|
||||
var testDOMFiles;
|
||||
|
||||
function createFiles() {
|
||||
var filesToCreate = new Array();
|
||||
extensions.forEach(function (extension) {
|
||||
filesToCreate.push({name: "testfile" + extension, data: testData});
|
||||
});
|
||||
SpecialPowers.createFiles(filesToCreate,
|
||||
function (files) {
|
||||
testDOMFiles = files;
|
||||
gen.next();
|
||||
},
|
||||
function (msg) {
|
||||
testDOMFiles = new Array;
|
||||
ok(false, "File creation error: " + msg);
|
||||
gen.next();
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
function continueTest() { gen.next(); }
|
||||
|
||||
function runTests() {
|
||||
|
||||
xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", "file_XHRSendData_doc.xml", false);
|
||||
xhr.send();
|
||||
@@ -38,12 +59,6 @@ testDoc2.appendChild(testDoc2.createElement("res"));
|
||||
testDoc2.documentElement.appendChild(testDoc2.createTextNode("text"));
|
||||
is(testDoc2.inputEncoding, "UTF-8", "wrong encoding");
|
||||
|
||||
var testData = "blahblahblahblahblahblahblaaaaaaaah. blah.";
|
||||
var extensions = [".txt",".png",".jpg",".gif",".xml", "noext"];
|
||||
var fileTypes = ["text/plain", "image/png", "image/jpeg", "image/gif", "text/xml", null];
|
||||
var testFiles = new Array;
|
||||
var testDOMFiles = new Array;
|
||||
|
||||
// arraybuffer test objects
|
||||
var shortArray = new ArrayBuffer(1);
|
||||
var shortInt8View = new Uint8Array(shortArray);
|
||||
@@ -64,28 +79,6 @@ var longInt16View2 = new Uint16Array(longArray, 256, 64)
|
||||
var longInt8View1 = new Int8Array(longArraySlice)
|
||||
var longInt8View2 = new Int8Array(longArray, 256, 128)
|
||||
|
||||
extensions.forEach(
|
||||
function (extension) {
|
||||
var testFile = createFileWithDataExt(testData, extension);
|
||||
testFiles.push(testFile);
|
||||
|
||||
var fileList = document.getElementById('fileList');
|
||||
SpecialPowers.wrap(fileList).value = testFile.path;
|
||||
testDOMFiles.push(fileList.files[0]);
|
||||
}
|
||||
);
|
||||
|
||||
function createFileWithDataExt(fileData, extension) {
|
||||
var testFile = SpecialPowers.Services.dirsvc.get("ProfD", SpecialPowers.Ci.nsIFile);
|
||||
testFile.append("testfile" + extension);
|
||||
var outStream = SpecialPowers.Cc["@mozilla.org/network/file-output-stream;1"].createInstance(SpecialPowers.Ci.nsIFileOutputStream);
|
||||
outStream.init(testFile, 0x02 | 0x08 | 0x20, 0666, 0);
|
||||
outStream.write(fileData, fileData.length);
|
||||
outStream.close();
|
||||
|
||||
return testFile;
|
||||
}
|
||||
|
||||
tests = [{ body: null,
|
||||
resBody: "",
|
||||
},
|
||||
@@ -253,19 +246,7 @@ try {
|
||||
"Wrong page for redirect");
|
||||
}
|
||||
}
|
||||
}
|
||||
finally {
|
||||
cleanUpData();
|
||||
}
|
||||
|
||||
function cleanUpData() {
|
||||
testFiles.forEach(
|
||||
function (testFile) {
|
||||
try {
|
||||
testFile.remove(false);
|
||||
} catch (e) {}
|
||||
}
|
||||
);
|
||||
} catch (e) {
|
||||
}
|
||||
|
||||
function is_identical_arraybuffer(ab1, ab2) {
|
||||
|
||||
@@ -621,7 +621,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=338583
|
||||
function doTest()
|
||||
{
|
||||
// Allow all cookies, then run the actual test
|
||||
SpecialPowers.pushPrefEnv({"set": [["network.cookie.cookieBehavior", 0], ["dom.server-events.enabled", true]]}, function() { SpecialPowers.pushPermissions([{'type': 'systemXHR', 'allow': true, 'context': document}], doTestCallback);});
|
||||
SpecialPowers.pushPrefEnv({"set": [["network.cookie.cookieBehavior", 0]]},
|
||||
function() {
|
||||
SpecialPowers.pushPermissions([{'type': 'systemXHR', 'allow': true, 'context': document}],
|
||||
doTestCallback);
|
||||
});
|
||||
}
|
||||
|
||||
function doTestCallback()
|
||||
|
||||
@@ -224,7 +224,7 @@ function testHtmlSerializer_1 () {
|
||||
encoder.init(document, "application/xhtml+xml",de.OutputSelectionOnly | de.OutputRaw);
|
||||
encoder.setNode(node);
|
||||
out = encoder.encodeToString();
|
||||
expected = '<hr xmlns="http://www.w3.org/1999/xhtml" noshade="noshade" id="shortattr6" />';
|
||||
expected = '<hr xmlns="http://www.w3.org/1999/xhtml" id="shortattr6" noshade="noshade" />';
|
||||
is(out, expected, "test short attr #6");
|
||||
|
||||
node = document.getElementById('shortattr7');
|
||||
@@ -239,7 +239,7 @@ function testHtmlSerializer_1 () {
|
||||
encoder.init(document, "text/html", de.OutputLFLineBreak | de.OutputSelectionOnly | de.OutputRaw);
|
||||
encoder.setNode(node);
|
||||
out = encoder.encodeToString();
|
||||
expected = '<div __moz_b="b" id="mozattr"> lorem ipsum</div>';
|
||||
expected = '<div id="mozattr" __moz_b="b"> lorem ipsum</div>';
|
||||
is(out, expected, "test -moz/_moz attr");
|
||||
|
||||
node.setAttribute('_moz_c','barc');
|
||||
@@ -249,7 +249,7 @@ function testHtmlSerializer_1 () {
|
||||
encoder.init(document, "text/html", de.OutputLFLineBreak | de.OutputSelectionOnly | de.OutputRaw);
|
||||
encoder.setNode(node);
|
||||
out = encoder.encodeToString();
|
||||
expected = '<div __moz_e="bare" _-moz_d="bard" __moz_b="b" id="mozattr"> lorem ipsum</div>';
|
||||
expected = '<div id="mozattr" __moz_b="b" _-moz_d="bard" __moz_e="bare"> lorem ipsum</div>';
|
||||
is(out, expected, "test -moz/_moz attr #2");
|
||||
|
||||
SimpleTest.finish();
|
||||
@@ -284,7 +284,7 @@ addLoadEvent(testHtmlSerializer_1);
|
||||
<object id="shortattr3" declare="" />
|
||||
<script id="shortattr4" defer="" />
|
||||
<select id="shortattr5" multiple=""><option selected="">aaa</option></select>
|
||||
<hr noshade="" id="shortattr6"/>
|
||||
<hr id="shortattr6" noshade=""/>
|
||||
<div id="shortattr7"><foo:bar checked="" value="" disabled="" ismap="" readonly="" /></div>
|
||||
<div id="mozattr" _moz_a="a" __moz_b="b"> lorem ipsum</div>
|
||||
</div>
|
||||
|
||||
@@ -174,7 +174,7 @@ function testHtmlSerializer_1 () {
|
||||
encoder.init(document, "text/html", de.OutputLFLineBreak | de.OutputSelectionOnly);
|
||||
encoder.setSelection(select);
|
||||
out = encoder.encodeToString();
|
||||
expected = '<ol start="5" id="aList"><li>sit amet, <strong>consectetuer</strong> </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n</ol>';
|
||||
expected = '<ol id="aList" start="5"><li>sit amet, <strong>consectetuer</strong> </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n</ol>';
|
||||
is(out, expected, "test list selection with range: selection start at the third child of the ol, and end after the element ol + ol start at the value 5");
|
||||
|
||||
|
||||
@@ -272,7 +272,7 @@ function testHtmlSerializer_1 () {
|
||||
encoder.init(document, "text/html", de.OutputLFLineBreak | de.OutputSelectionOnly | de.OutputRaw);
|
||||
encoder.setNode(node);
|
||||
out = encoder.encodeToString();
|
||||
expected = '<div __moz_e="bare" _-moz_d="bard" id="mozattr" __moz_b="b"> lorem ipsum</div>';
|
||||
expected = '<div id="mozattr" __moz_b="b" _-moz_d="bard" __moz_e="bare"> lorem ipsum</div>';
|
||||
is(out, expected, "test -moz/_moz attr #2");
|
||||
|
||||
SimpleTest.finish();
|
||||
@@ -317,4 +317,4 @@ addLoadEvent(testHtmlSerializer_1);
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
@@ -54,19 +54,19 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=744830
|
||||
is(t.innerHTML, '<example xml:lang="us-en"><foo></example>');
|
||||
|
||||
t.firstChild.setAttributeNS("http://www.w3.org/1999/xlink", "href", "foo");
|
||||
is(t.innerHTML, '<example xlink:href="foo" xml:lang="us-en"><foo></example>');
|
||||
is(t.innerHTML, '<example xml:lang="us-en" xlink:href="foo"><foo></example>');
|
||||
|
||||
t.firstChild.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns", "http://foo");
|
||||
is(t.innerHTML, '<example xmlns="http://foo" xlink:href="foo" xml:lang="us-en"><foo></example>');
|
||||
is(t.innerHTML, '<example xml:lang="us-en" xlink:href="foo" xmlns="http://foo"><foo></example>');
|
||||
|
||||
t.firstChild.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:bar", "http://bar");
|
||||
is(t.innerHTML, '<example xmlns:bar="http://bar" xmlns="http://foo" xlink:href="foo" xml:lang="us-en"><foo></example>');
|
||||
is(t.innerHTML, '<example xml:lang="us-en" xlink:href="foo" xmlns="http://foo" xmlns:bar="http://bar"><foo></example>');
|
||||
|
||||
t.firstChild.setAttributeNS("http://www.helloworldns.org", "hello:world", "!");
|
||||
is(t.innerHTML, '<example hello:world="!" xmlns:bar="http://bar" xmlns="http://foo" xlink:href="foo" xml:lang="us-en"><foo></example>');
|
||||
is(t.innerHTML, '<example xml:lang="us-en" xlink:href="foo" xmlns="http://foo" xmlns:bar="http://bar" hello:world="!"><foo></example>');
|
||||
|
||||
t.firstChild.setAttribute("foo", '-"&\xA0-');
|
||||
is(t.innerHTML, '<example foo="-"& -" hello:world="!" xmlns:bar="http://bar" xmlns="http://foo" xlink:href="foo" xml:lang="us-en"><foo></example>');
|
||||
is(t.innerHTML, '<example xml:lang="us-en" xlink:href="foo" xmlns="http://foo" xmlns:bar="http://bar" hello:world="!" foo="-"& -"><foo></example>');
|
||||
|
||||
t.innerHTML = null;
|
||||
t.appendChild(document.createElement("div"));
|
||||
|
||||
@@ -118,7 +118,7 @@ function testHtmlCopyEncoder () {
|
||||
encoder.init(document, "text/html", de.OutputLFLineBreak | de.OutputSelectionOnly);
|
||||
encoder.setSelection(select);
|
||||
out = encoder.encodeToString();
|
||||
expected = '<ol start=\"5\" id=\"aList\"><li value=\"6\">sit amet, <strong>consectetuer</strong> </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n</ol>';
|
||||
expected = '<ol id=\"aList\" start=\"5\"><li value=\"6\">sit amet, <strong>consectetuer</strong> </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n</ol>';
|
||||
is(out, expected, "test list selection with range: selection start at the third child of the ol, and end after the element ol + ol start at the value 5");
|
||||
|
||||
// selection contains only some child of the ol
|
||||
|
||||
@@ -38,11 +38,7 @@ function testHtmlCopyEncoder () {
|
||||
encoder.init(document, "text/html", de.OutputLFLineBreak | de.OutputSelectionOnly);
|
||||
encoder.setNode(node);
|
||||
out = encoder.encodeToString();
|
||||
// the attributes are in the reverse order because the XHTML parser parse in the
|
||||
// right order but the html serializer serializes in the reverse order
|
||||
// (because the html parser stores the attribute in the reverse order,
|
||||
// see bug 213347 for reason).
|
||||
expected = "<div ondragstart=\"doDragStartSelection(event)\" id=\"draggable\">This is a <em>draggable</em> <br>bit of text.</div>";
|
||||
expected = "<div id=\"draggable\" ondragstart=\"doDragStartSelection(event)\">This is a <em>draggable</em> <br>bit of text.</div>";
|
||||
is(out, expected, "test node");
|
||||
|
||||
var select = window.getSelection();
|
||||
|
||||
@@ -89,6 +89,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=887836
|
||||
{ input: '%a_=a', data: { '%a_' : ['a'] } },
|
||||
{ input: '%61=a', data: { 'a' : ['a'] } },
|
||||
{ input: '%61+%4d%4D=', data: { 'a MM' : [''] } },
|
||||
{ input: '?a=1', data: { 'a' : ['1'] } },
|
||||
{ input: '?', data: {} },
|
||||
{ input: '?=b', data: { '' : ['b'] } },
|
||||
];
|
||||
|
||||
for (var i = 0; i < checks.length; ++i) {
|
||||
|
||||
@@ -1586,18 +1586,16 @@ CanvasRenderingContext2D::ReturnTarget()
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CanvasRenderingContext2D::InitializeWithSurface(nsIDocShell* aShell,
|
||||
gfxASurface* aSurface,
|
||||
int32_t aWidth,
|
||||
int32_t aHeight)
|
||||
CanvasRenderingContext2D::InitializeWithDrawTarget(nsIDocShell* aShell,
|
||||
gfx::DrawTarget* aTarget)
|
||||
{
|
||||
RemovePostRefreshObserver();
|
||||
mDocShell = aShell;
|
||||
AddPostRefreshObserverIfNecessary();
|
||||
|
||||
SetDimensions(aWidth, aHeight);
|
||||
mTarget = gfxPlatform::GetPlatform()->
|
||||
CreateDrawTargetForSurface(aSurface, IntSize(aWidth, aHeight));
|
||||
IntSize size = aTarget->GetSize();
|
||||
SetDimensions(size.width, size.height);
|
||||
mTarget = aTarget;
|
||||
|
||||
if (!mTarget) {
|
||||
EnsureErrorTarget();
|
||||
|
||||
@@ -443,7 +443,8 @@ public:
|
||||
return nullptr;
|
||||
}
|
||||
NS_IMETHOD SetDimensions(int32_t aWidth, int32_t aHeight) override;
|
||||
NS_IMETHOD InitializeWithSurface(nsIDocShell* aShell, gfxASurface* aSurface, int32_t aWidth, int32_t aHeight) override;
|
||||
NS_IMETHOD InitializeWithDrawTarget(nsIDocShell* aShell,
|
||||
gfx::DrawTarget* aTarget) override;
|
||||
|
||||
NS_IMETHOD GetInputStream(const char* aMimeType,
|
||||
const char16_t* aEncoderOptions,
|
||||
|
||||
@@ -82,10 +82,8 @@ ImageBitmapRenderingContext::SetDimensions(int32_t aWidth, int32_t aHeight)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
ImageBitmapRenderingContext::InitializeWithSurface(nsIDocShell* aDocShell,
|
||||
gfxASurface* aSurface,
|
||||
int32_t aWidth,
|
||||
int32_t aHeight)
|
||||
ImageBitmapRenderingContext::InitializeWithDrawTarget(nsIDocShell* aDocShell,
|
||||
gfx::DrawTarget* aTarget)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace mozilla {
|
||||
|
||||
namespace gfx {
|
||||
class DataSourceSurface;
|
||||
class DrawTarget;
|
||||
class SourceSurface;
|
||||
}
|
||||
|
||||
@@ -53,10 +54,8 @@ public:
|
||||
|
||||
NS_IMETHOD SetDimensions(int32_t aWidth, int32_t aHeight) override;
|
||||
|
||||
NS_IMETHOD InitializeWithSurface(nsIDocShell* aDocShell,
|
||||
gfxASurface* aSurface,
|
||||
int32_t aWidth,
|
||||
int32_t aHeight) override;
|
||||
NS_IMETHOD InitializeWithDrawTarget(nsIDocShell* aDocShell,
|
||||
gfx::DrawTarget* aTarget) override;
|
||||
|
||||
virtual mozilla::UniquePtr<uint8_t[]> GetImageBuffer(int32_t* aFormat) override;
|
||||
NS_IMETHOD GetInputStream(const char* aMimeType,
|
||||
|
||||
@@ -240,8 +240,7 @@ public:
|
||||
virtual int32_t GetHeight() const override;
|
||||
|
||||
NS_IMETHOD SetDimensions(int32_t width, int32_t height) override;
|
||||
NS_IMETHOD InitializeWithSurface(nsIDocShell*, gfxASurface*, int32_t,
|
||||
int32_t) override
|
||||
NS_IMETHOD InitializeWithDrawTarget(nsIDocShell*, gfx::DrawTarget*) override
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
@@ -96,7 +96,10 @@ public:
|
||||
// whenever the size of the element changes.
|
||||
NS_IMETHOD SetDimensions(int32_t width, int32_t height) = 0;
|
||||
|
||||
NS_IMETHOD InitializeWithSurface(nsIDocShell *docShell, gfxASurface *surface, int32_t width, int32_t height) = 0;
|
||||
// Initializes with an nsIDocShell and DrawTarget. The size is taken from the
|
||||
// DrawTarget.
|
||||
NS_IMETHOD InitializeWithDrawTarget(nsIDocShell *aDocShell,
|
||||
mozilla::gfx::DrawTarget* aTarget) = 0;
|
||||
|
||||
// Creates an image buffer. Returns null on failure.
|
||||
virtual mozilla::UniquePtr<uint8_t[]> GetImageBuffer(int32_t* format) = 0;
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "nsRuleData.h"
|
||||
#include "nsMappedAttributes.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsIContentSecurityPolicy.h"
|
||||
#include "nsIURI.h"
|
||||
|
||||
NS_IMPL_NS_NEW_HTML_ELEMENT(Shared)
|
||||
@@ -174,12 +175,28 @@ SetBaseURIUsingFirstBaseWithHref(nsIDocument* aDocument, nsIContent* aMustMatch)
|
||||
getter_AddRefs(newBaseURI), href, aDocument,
|
||||
aDocument->GetFallbackBaseURI());
|
||||
|
||||
// Try to set our base URI. If that fails, try to set base URI to null
|
||||
nsresult rv = aDocument->SetBaseURI(newBaseURI);
|
||||
aDocument->SetChromeXHRDocBaseURI(nullptr);
|
||||
// Check if CSP allows this base-uri
|
||||
nsCOMPtr<nsIContentSecurityPolicy> csp;
|
||||
nsresult rv = aDocument->NodePrincipal()->GetCsp(getter_AddRefs(csp));
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "Getting CSP Failed");
|
||||
// For all the different error cases we assign a nullptr to
|
||||
// newBaseURI, so we basically call aDocument->SetBaseURI(nullptr);
|
||||
if (NS_FAILED(rv)) {
|
||||
aDocument->SetBaseURI(nullptr);
|
||||
newBaseURI = nullptr;
|
||||
}
|
||||
if (csp && newBaseURI) {
|
||||
// base-uri is only enforced if explicitly defined in the
|
||||
// policy - do *not* consult default-src, see:
|
||||
// http://www.w3.org/TR/CSP2/#directive-default-src
|
||||
bool cspPermitsBaseURI = true;
|
||||
rv = csp->Permits(newBaseURI, nsIContentSecurityPolicy::BASE_URI_DIRECTIVE,
|
||||
true, &cspPermitsBaseURI);
|
||||
if (NS_FAILED(rv) || !cspPermitsBaseURI) {
|
||||
newBaseURI = nullptr;
|
||||
}
|
||||
}
|
||||
aDocument->SetBaseURI(newBaseURI);
|
||||
aDocument->SetChromeXHRDocBaseURI(nullptr);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,6 @@ SetAttributeNodeNSWarning=Use of setAttributeNodeNS() is deprecated. Use setAttr
|
||||
RemoveAttributeNodeWarning=Use of removeAttributeNode() is deprecated. Use removeAttribute() instead.
|
||||
CreateAttributeWarning=Use of document.createAttribute() is deprecated. Use element.setAttribute() instead.
|
||||
CreateAttributeNSWarning=Use of document.createAttributeNS() is deprecated. Use element.setAttributeNS() instead.
|
||||
OwnerElementWarning=Use of attributes' ownerElement attribute is deprecated.
|
||||
NodeValueWarning=Use of attributes' nodeValue attribute is deprecated. Use value instead.
|
||||
TextContentWarning=Use of attributes' textContent attribute is deprecated. Use value instead.
|
||||
EnablePrivilegeWarning=Use of enablePrivilege is deprecated. Please use code that runs with the system principal (e.g. an extension) instead.
|
||||
|
||||
@@ -22,6 +22,9 @@
|
||||
#include "prio.h"
|
||||
#include "mozilla/dom/CrashReporterChild.h"
|
||||
#include "mozilla/ipc/ProcessChild.h"
|
||||
#ifdef MOZ_WIDEVINE_EME
|
||||
#include "widevine-adapter/WidevineAdapter.h"
|
||||
#endif
|
||||
|
||||
using namespace mozilla::ipc;
|
||||
using mozilla::dom::CrashReporterChild;
|
||||
@@ -212,7 +215,7 @@ GetAppPaths(nsCString &aAppPath, nsCString &aAppBinaryPath)
|
||||
}
|
||||
|
||||
bool
|
||||
GMPChild::SetMacSandboxInfo()
|
||||
GMPChild::SetMacSandboxInfo(MacSandboxPluginType aPluginType)
|
||||
{
|
||||
if (!mGMPLoader) {
|
||||
return false;
|
||||
@@ -228,7 +231,7 @@ GMPChild::SetMacSandboxInfo()
|
||||
|
||||
MacSandboxInfo info;
|
||||
info.type = MacSandboxType_Plugin;
|
||||
info.pluginInfo.type = MacSandboxPluginType_GMPlugin_Default;
|
||||
info.pluginInfo.type = aPluginType;
|
||||
info.pluginInfo.pluginPath.assign(pluginDirectoryPath.get());
|
||||
info.pluginInfo.pluginBinaryPath.assign(pluginFilePath.get());
|
||||
info.appPath.assign(appPath.get());
|
||||
@@ -372,8 +375,18 @@ GMPChild::AnswerStartPlugin(const nsString& aAdapter)
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef MOZ_WIDEVINE_EME
|
||||
bool isWidevine = aAdapter.EqualsLiteral("widevine");
|
||||
#endif
|
||||
|
||||
#if defined(MOZ_GMP_SANDBOX) && defined(XP_MACOSX)
|
||||
if (!SetMacSandboxInfo()) {
|
||||
MacSandboxPluginType pluginType = MacSandboxPluginType_GMPlugin_Default;
|
||||
#ifdef MOZ_WIDEVINE_EME
|
||||
if (isWidevine) {
|
||||
pluginType = MacSandboxPluginType_GMPlugin_EME_Widevine;
|
||||
}
|
||||
#endif
|
||||
if (!SetMacSandboxInfo(pluginType)) {
|
||||
NS_WARNING("Failed to set Mac GMP sandbox info");
|
||||
delete platformAPI;
|
||||
return false;
|
||||
@@ -381,6 +394,11 @@ GMPChild::AnswerStartPlugin(const nsString& aAdapter)
|
||||
#endif
|
||||
|
||||
GMPAdapter* adapter = nullptr;
|
||||
#ifdef MOZ_WIDEVINE_EME
|
||||
if (isWidevine) {
|
||||
adapter = new WidevineAdapter();
|
||||
}
|
||||
#endif
|
||||
if (!mGMPLoader->Load(libPath.get(),
|
||||
libPath.Length(),
|
||||
mNodeId.BeginWriting(),
|
||||
|
||||
@@ -41,7 +41,7 @@ public:
|
||||
void ShutdownComplete() override;
|
||||
|
||||
#if defined(XP_MACOSX) && defined(MOZ_GMP_SANDBOX)
|
||||
bool SetMacSandboxInfo();
|
||||
bool SetMacSandboxInfo(MacSandboxPluginType aPluginType);
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
||||
+92
-19
@@ -39,6 +39,15 @@ using CrashReporter::GetIDFromMinidump;
|
||||
|
||||
#include "mozilla/Telemetry.h"
|
||||
|
||||
#ifdef XP_WIN
|
||||
#include "WMFDecoderModule.h"
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_WIDEVINE_EME
|
||||
#include "mozilla/dom/WidevineCDMManifestBinding.h"
|
||||
#include "widevine-adapter/WidevineAdapter.h"
|
||||
#endif
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
#undef LOG
|
||||
@@ -570,6 +579,23 @@ GMPParent::SupportsAPI(const nsCString& aAPI, const nsCString& aTag)
|
||||
nsTArray<nsCString>& tags = mCapabilities[i].mAPITags;
|
||||
for (uint32_t j = 0; j < tags.Length(); j++) {
|
||||
if (tags[j].Equals(aTag)) {
|
||||
#ifdef XP_WIN
|
||||
// Clearkey on Windows advertises that it can decode in its GMP info
|
||||
// file, but uses Windows Media Foundation to decode. That's not present
|
||||
// on Windows XP, and on some Vista, Windows N, and KN variants without
|
||||
// certain services packs.
|
||||
if (tags[j].EqualsLiteral("org.w3.clearkey")) {
|
||||
if (mCapabilities[i].mAPIName.EqualsLiteral(GMP_API_VIDEO_DECODER)) {
|
||||
if (!WMFDecoderModule::HasH264()) {
|
||||
continue;
|
||||
}
|
||||
} else if (mCapabilities[i].mAPIName.EqualsLiteral(GMP_API_AUDIO_DECODER)) {
|
||||
if (!WMFDecoderModule::HasAAC()) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -787,7 +813,18 @@ GMPParent::ReadGMPMetaData()
|
||||
return ReadGMPInfoFile(infoFile);
|
||||
}
|
||||
|
||||
#ifdef MOZ_WIDEVINE_EME
|
||||
// Maybe this is the Widevine adapted plugin?
|
||||
nsCOMPtr<nsIFile> manifestFile;
|
||||
rv = mDirectory->Clone(getter_AddRefs(manifestFile));
|
||||
if (NS_FAILED(rv)) {
|
||||
return GenericPromise::CreateAndReject(rv, __func__);
|
||||
}
|
||||
manifestFile->AppendRelativePath(NS_LITERAL_STRING("manifest.json"));
|
||||
return ReadChromiumManifestFile(manifestFile);
|
||||
#else
|
||||
return GenericPromise::CreateAndReject(rv, __func__);
|
||||
#endif
|
||||
}
|
||||
|
||||
RefPtr<GenericPromise>
|
||||
@@ -872,25 +909,6 @@ GMPParent::ReadGMPInfoFile(nsIFile* aFile)
|
||||
#endif // XP_WIN
|
||||
}
|
||||
|
||||
#ifdef XP_WIN
|
||||
// Clearkey on Windows advertises that it can decode in its GMP info
|
||||
// file, but uses Windows Media Foundation to decode. That's not present
|
||||
// on Windows XP, and on some Vista, Windows N, and KN variants without
|
||||
// certain services packs. So don't add the decoding capability to
|
||||
// gmp-clearkey's GMPParent if it's not going to be able to use WMF to
|
||||
// decode.
|
||||
if (cap.mAPIName.EqualsLiteral(GMP_API_VIDEO_DECODER) &&
|
||||
cap.mAPITags.Contains(NS_LITERAL_CSTRING("org.w3.clearkey")) &&
|
||||
!WMFDecoderModule::HasH264()) {
|
||||
continue;
|
||||
}
|
||||
if (cap.mAPIName.EqualsLiteral(GMP_API_AUDIO_DECODER) &&
|
||||
cap.mAPITags.Contains(NS_LITERAL_CSTRING("org.w3.clearkey")) &&
|
||||
!WMFDecoderModule::HasAAC()) {
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
|
||||
mCapabilities.AppendElement(Move(cap));
|
||||
}
|
||||
|
||||
@@ -901,6 +919,61 @@ GMPParent::ReadGMPInfoFile(nsIFile* aFile)
|
||||
return GenericPromise::CreateAndResolve(true, __func__);
|
||||
}
|
||||
|
||||
#ifdef MOZ_WIDEVINE_EME
|
||||
RefPtr<GenericPromise>
|
||||
GMPParent::ReadChromiumManifestFile(nsIFile* aFile)
|
||||
{
|
||||
nsAutoCString json;
|
||||
if (!ReadIntoString(aFile, json, 5 * 1024)) {
|
||||
return GenericPromise::CreateAndReject(NS_ERROR_FAILURE, __func__);
|
||||
}
|
||||
|
||||
// DOM JSON parsing needs to run on the main thread.
|
||||
return InvokeAsync(AbstractThread::MainThread(), this, __func__,
|
||||
&GMPParent::ParseChromiumManifest, NS_ConvertUTF8toUTF16(json));
|
||||
}
|
||||
|
||||
RefPtr<GenericPromise>
|
||||
GMPParent::ParseChromiumManifest(nsString aJSON)
|
||||
{
|
||||
LOGD("%s: for '%s'", __FUNCTION__, NS_LossyConvertUTF16toASCII(aJSON).get());
|
||||
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
mozilla::dom::WidevineCDMManifest m;
|
||||
if (!m.Init(aJSON)) {
|
||||
return GenericPromise::CreateAndReject(NS_ERROR_FAILURE, __func__);
|
||||
}
|
||||
|
||||
nsresult ignored; // Note: ToInteger returns 0 on failure.
|
||||
if (!WidevineAdapter::Supports(m.mX_cdm_module_versions.ToInteger(&ignored),
|
||||
m.mX_cdm_interface_versions.ToInteger(&ignored),
|
||||
m.mX_cdm_host_versions.ToInteger(&ignored))) {
|
||||
return GenericPromise::CreateAndReject(NS_ERROR_FAILURE, __func__);
|
||||
}
|
||||
|
||||
mDisplayName = NS_ConvertUTF16toUTF8(m.mName);
|
||||
mDescription = NS_ConvertUTF16toUTF8(m.mDescription);
|
||||
mVersion = NS_ConvertUTF16toUTF8(m.mVersion);
|
||||
|
||||
GMPCapability video(NS_LITERAL_CSTRING(GMP_API_VIDEO_DECODER));
|
||||
video.mAPITags.AppendElement(NS_LITERAL_CSTRING("h264"));
|
||||
video.mAPITags.AppendElement(NS_LITERAL_CSTRING("com.widevine.alpha"));
|
||||
mCapabilities.AppendElement(Move(video));
|
||||
|
||||
GMPCapability decrypt(NS_LITERAL_CSTRING(GMP_API_DECRYPTOR));
|
||||
decrypt.mAPITags.AppendElement(NS_LITERAL_CSTRING("com.widevine.alpha"));
|
||||
mCapabilities.AppendElement(Move(decrypt));
|
||||
|
||||
MOZ_ASSERT(mName.EqualsLiteral("widevinecdm"));
|
||||
mAdapter = NS_LITERAL_STRING("widevine");
|
||||
#ifdef XP_WIN
|
||||
mLibs = NS_LITERAL_CSTRING("dxva2.dll");
|
||||
#endif
|
||||
|
||||
return GenericPromise::CreateAndResolve(true, __func__);
|
||||
}
|
||||
#endif
|
||||
|
||||
bool
|
||||
GMPParent::CanBeSharedCrossNodeIds() const
|
||||
{
|
||||
|
||||
@@ -167,6 +167,10 @@ private:
|
||||
bool EnsureProcessLoaded();
|
||||
RefPtr<GenericPromise> ReadGMPMetaData();
|
||||
RefPtr<GenericPromise> ReadGMPInfoFile(nsIFile* aFile);
|
||||
#ifdef MOZ_WIDEVINE_EME
|
||||
RefPtr<GenericPromise> ParseChromiumManifest(nsString aJSON); // Main thread.
|
||||
RefPtr<GenericPromise> ReadChromiumManifestFile(nsIFile* aFile); // GMP thread.
|
||||
#endif
|
||||
#ifdef MOZ_CRASHREPORTER
|
||||
void WriteExtraDataForMinidump(CrashReporter::AnnotationTable& notes);
|
||||
void GetCrashID(nsString& aResult);
|
||||
|
||||
@@ -39,6 +39,44 @@ static bool SchemeIs(nsIURI* aURI, const char* aScheme)
|
||||
return NS_SUCCEEDED(baseURI->SchemeIs(aScheme, &isScheme)) && isScheme;
|
||||
}
|
||||
|
||||
|
||||
static bool IsImageLoadInEditorAppType(nsILoadInfo* aLoadInfo)
|
||||
{
|
||||
// Editor apps get special treatment here, editors can load images
|
||||
// from anywhere. This allows editor to insert images from file://
|
||||
// into documents that are being edited.
|
||||
nsContentPolicyType type = aLoadInfo->InternalContentPolicyType();
|
||||
if (type != nsIContentPolicy::TYPE_INTERNAL_IMAGE &&
|
||||
type != nsIContentPolicy::TYPE_INTERNAL_IMAGE_PRELOAD &&
|
||||
type != nsIContentPolicy::TYPE_IMAGESET) {
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32_t appType = nsIDocShell::APP_TYPE_UNKNOWN;
|
||||
nsINode* node = aLoadInfo->LoadingNode();
|
||||
if (!node) {
|
||||
return false;
|
||||
}
|
||||
nsIDocument* doc = node->OwnerDoc();
|
||||
if (!doc) {
|
||||
return false;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem = doc->GetDocShell();
|
||||
if (!docShellTreeItem) {
|
||||
return false;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDocShellTreeItem> root;
|
||||
docShellTreeItem->GetRootTreeItem(getter_AddRefs(root));
|
||||
nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(root));
|
||||
if (!docShell || NS_FAILED(docShell->GetAppType(&appType))) {
|
||||
appType = nsIDocShell::APP_TYPE_UNKNOWN;
|
||||
}
|
||||
|
||||
return appType == nsIDocShell::APP_TYPE_EDITOR;
|
||||
}
|
||||
|
||||
static nsresult
|
||||
DoCheckLoadURIChecks(nsIURI* aURI, nsILoadInfo* aLoadInfo)
|
||||
{
|
||||
@@ -55,8 +93,11 @@ DoCheckLoadURIChecks(nsIURI* aURI, nsILoadInfo* aLoadInfo)
|
||||
flags |= nsIScriptSecurityManager::ALLOW_CHROME;
|
||||
}
|
||||
|
||||
bool isImageInEditorType = IsImageLoadInEditorAppType(aLoadInfo);
|
||||
|
||||
// We don't have a loadingPrincipal for TYPE_DOCUMENT
|
||||
if (aLoadInfo->GetExternalContentPolicyType() != nsIContentPolicy::TYPE_DOCUMENT) {
|
||||
if (aLoadInfo->GetExternalContentPolicyType() != nsIContentPolicy::TYPE_DOCUMENT &&
|
||||
!isImageInEditorType) {
|
||||
rv = nsContentUtils::GetSecurityManager()->
|
||||
CheckLoadURIWithPrincipal(loadingPrincipal,
|
||||
aURI,
|
||||
@@ -67,7 +108,7 @@ DoCheckLoadURIChecks(nsIURI* aURI, nsILoadInfo* aLoadInfo)
|
||||
// If the loadingPrincipal and the triggeringPrincipal are different, then make
|
||||
// sure the triggeringPrincipal is allowed to access that URI.
|
||||
nsCOMPtr<nsIPrincipal> triggeringPrincipal = aLoadInfo->TriggeringPrincipal();
|
||||
if (loadingPrincipal != triggeringPrincipal) {
|
||||
if (loadingPrincipal != triggeringPrincipal && !isImageInEditorType) {
|
||||
rv = nsContentUtils::GetSecurityManager()->
|
||||
CheckLoadURIWithPrincipal(triggeringPrincipal,
|
||||
aURI,
|
||||
@@ -155,7 +196,8 @@ DoContentSecurityChecks(nsIURI* aURI, nsILoadInfo* aLoadInfo)
|
||||
}
|
||||
|
||||
case nsIContentPolicy::TYPE_IMAGE: {
|
||||
MOZ_ASSERT(false, "contentPolicyType not supported yet");
|
||||
mimeTypeGuess = EmptyCString();
|
||||
requestingContext = aLoadInfo->LoadingNode();
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -295,7 +337,8 @@ DoContentSecurityChecks(nsIURI* aURI, nsILoadInfo* aLoadInfo)
|
||||
}
|
||||
|
||||
case nsIContentPolicy::TYPE_IMAGESET: {
|
||||
MOZ_ASSERT(false, "contentPolicyType not supported yet");
|
||||
mimeTypeGuess = EmptyCString();
|
||||
requestingContext = aLoadInfo->LoadingNode();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,8 @@ interface DOMTokenList {
|
||||
[Throws]
|
||||
void remove(DOMString... tokens);
|
||||
[Throws]
|
||||
void replace(DOMString token, DOMString newToken);
|
||||
[Throws]
|
||||
boolean toggle(DOMString token, optional boolean force);
|
||||
[SetterThrows]
|
||||
attribute DOMString value;
|
||||
|
||||
@@ -4,15 +4,14 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* The origin of this IDL file is
|
||||
* http://www.whatwg.org/specs/web-apps/current-work/
|
||||
* https://html.spec.whatwg.org/multipage/comms.html#the-eventsource-interface
|
||||
*
|
||||
* © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
|
||||
* Opera Software ASA. You are granted a license to use, reproduce
|
||||
* and create derivative works of this document.
|
||||
*/
|
||||
|
||||
[Constructor(DOMString url, optional EventSourceInit eventSourceInitDict),
|
||||
Func="mozilla::dom::EventSource::PrefEnabled"]
|
||||
[Constructor(USVString url, optional EventSourceInit eventSourceInitDict)]
|
||||
interface EventSource : EventTarget {
|
||||
[Constant]
|
||||
readonly attribute DOMString url;
|
||||
|
||||
@@ -69,8 +69,7 @@ partial interface KeyframeEffectReadOnly {
|
||||
object? frames,
|
||||
optional (unrestricted double or KeyframeEffectOptions) options)]
|
||||
interface KeyframeEffect : KeyframeEffectReadOnly {
|
||||
// Bug 1067769 - Allow setting KeyframeEffect.target
|
||||
// inherit attribute Animatable? target;
|
||||
inherit attribute (Element or CSSPseudoElement)? target;
|
||||
// Bug 1216843 - implement animation composition
|
||||
// inherit attribute IterationCompositeOperation iterationComposite;
|
||||
// Bug 1216844 - implement additive animation
|
||||
|
||||
@@ -4,10 +4,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/. */
|
||||
|
||||
// XXX: This must be done prior to including cert.h (directly or indirectly).
|
||||
// CERT_AddTempCertToPerm is exposed as __CERT_AddTempCertToPerm.
|
||||
#define CERT_AddTempCertToPerm __CERT_AddTempCertToPerm
|
||||
|
||||
#include "WifiCertService.h"
|
||||
|
||||
#include "mozilla/ClearOnShutdown.h"
|
||||
|
||||
@@ -36,5 +36,6 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
|
||||
'WifiProxyService.cpp',
|
||||
'WifiUtils.cpp',
|
||||
]
|
||||
DEFINES['CERT_AddTempCertToPerm'] = '__CERT_AddTempCertToPerm'
|
||||
|
||||
FINAL_LIBRARY = 'xul'
|
||||
|
||||
@@ -83,6 +83,9 @@ onmessage = function() {
|
||||
{ input: '%a_=a', data: { '%a_' : ['a'] } },
|
||||
{ input: '%61=a', data: { 'a' : ['a'] } },
|
||||
{ input: '%61+%4d%4D=', data: { 'a MM' : [''] } },
|
||||
{ input: '?a=1', data: { 'a' : ['1'] } },
|
||||
{ input: '?', data: {} },
|
||||
{ input: '?=b', data: { '' : ['b'] } },
|
||||
];
|
||||
|
||||
for (var i = 0; i < checks.length; ++i) {
|
||||
|
||||
@@ -113,11 +113,6 @@ nsXBLResourceLoader::LoadResources(bool* aResult)
|
||||
continue;
|
||||
|
||||
if (curr->mType == nsGkAtoms::image) {
|
||||
if (!nsContentUtils::CanLoadImage(url, doc, doc, docPrincipal)) {
|
||||
// We're not permitted to load this image, move on...
|
||||
continue;
|
||||
}
|
||||
|
||||
// Now kick off the image load...
|
||||
// Passing nullptr for pretty much everything -- cause we don't care!
|
||||
// XXX: initialDocumentURI is nullptr!
|
||||
|
||||
@@ -1029,7 +1029,7 @@ nsHTMLEditor::UpdateBaseURL()
|
||||
// If no base tag, then set baseURL to the document's URL. This is very
|
||||
// important, else relative URLs for links and images are wrong
|
||||
if (!nodeList || !nodeList->Item(0)) {
|
||||
return doc->SetBaseURI(doc->GetDocumentURI());
|
||||
doc->SetBaseURI(doc->GetDocumentURI());
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
+54
-46
@@ -682,15 +682,35 @@ struct ParamTraits<mozilla::layers::FrameMetrics::ScrollOffsetUpdateType>
|
||||
mozilla::layers::FrameMetrics::ScrollOffsetUpdateType::eSentinel>
|
||||
{};
|
||||
|
||||
// Helper class for reading bitfields.
|
||||
// If T has bitfields members, derive ParamTraits<T> from BitfieldHelper<T>.
|
||||
template <typename ParamType>
|
||||
struct BitfieldHelper
|
||||
{
|
||||
// We need this helper because we can't get the address of a bitfield to
|
||||
// pass directly to ReadParam. So instead we read it into a temporary bool
|
||||
// and set the bitfield using a setter function
|
||||
static bool ReadBoolForBitfield(const Message* aMsg, void** aIter,
|
||||
ParamType* aResult, void (ParamType::*aSetter)(bool))
|
||||
{
|
||||
bool value;
|
||||
if (ReadParam(aMsg, aIter, &value)) {
|
||||
(aResult->*aSetter)(value);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct ParamTraits<mozilla::layers::FrameMetrics>
|
||||
: BitfieldHelper<mozilla::layers::FrameMetrics>
|
||||
{
|
||||
typedef mozilla::layers::FrameMetrics paramType;
|
||||
|
||||
static void Write(Message* aMsg, const paramType& aParam)
|
||||
{
|
||||
WriteParam(aMsg, aParam.mScrollId);
|
||||
WriteParam(aMsg, aParam.mScrollParentId);
|
||||
WriteParam(aMsg, aParam.mPresShellResolution);
|
||||
WriteParam(aMsg, aParam.mCompositionBounds);
|
||||
WriteParam(aMsg, aParam.mDisplayPort);
|
||||
@@ -707,51 +727,17 @@ struct ParamTraits<mozilla::layers::FrameMetrics>
|
||||
WriteParam(aMsg, aParam.mPresShellId);
|
||||
WriteParam(aMsg, aParam.mViewport);
|
||||
WriteParam(aMsg, aParam.mExtraResolution);
|
||||
WriteParam(aMsg, aParam.mBackgroundColor);
|
||||
WriteParam(aMsg, aParam.GetContentDescription());
|
||||
WriteParam(aMsg, aParam.mLineScrollAmount);
|
||||
WriteParam(aMsg, aParam.mPageScrollAmount);
|
||||
WriteParam(aMsg, aParam.mPaintRequestTime);
|
||||
WriteParam(aMsg, aParam.mScrollUpdateType);
|
||||
WriteParam(aMsg, aParam.mIsRootContent);
|
||||
WriteParam(aMsg, aParam.mHasScrollgrab);
|
||||
WriteParam(aMsg, aParam.mDoSmoothScroll);
|
||||
WriteParam(aMsg, aParam.mUseDisplayPortMargins);
|
||||
WriteParam(aMsg, aParam.mAllowVerticalScrollWithWheel);
|
||||
WriteParam(aMsg, aParam.mIsLayersIdRoot);
|
||||
WriteParam(aMsg, aParam.mUsesContainerScrolling);
|
||||
WriteParam(aMsg, aParam.mIsScrollInfoLayer);
|
||||
WriteParam(aMsg, aParam.mForceDisableApz);
|
||||
}
|
||||
|
||||
static bool ReadContentDescription(const Message* aMsg, void** aIter, paramType* aResult)
|
||||
{
|
||||
nsCString str;
|
||||
if (!ReadParam(aMsg, aIter, &str)) {
|
||||
return false;
|
||||
}
|
||||
aResult->SetContentDescription(str);
|
||||
return true;
|
||||
}
|
||||
|
||||
// We need this helper because we can't get the address of a bitfield to
|
||||
// pass directly to ReadParam. So instead we read it into a temporary bool
|
||||
// and set the bitfield using a setter function
|
||||
static bool ReadBoolForBitfield(const Message* aMsg, void** aIter,
|
||||
paramType* aResult, void (paramType::*aSetter)(bool))
|
||||
{
|
||||
bool value;
|
||||
if (ReadParam(aMsg, aIter, &value)) {
|
||||
(aResult->*aSetter)(value);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
||||
{
|
||||
return (ReadParam(aMsg, aIter, &aResult->mScrollId) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mScrollParentId) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mPresShellResolution) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mCompositionBounds) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mDisplayPort) &&
|
||||
@@ -768,21 +754,12 @@ struct ParamTraits<mozilla::layers::FrameMetrics>
|
||||
ReadParam(aMsg, aIter, &aResult->mPresShellId) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mViewport) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mExtraResolution) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mBackgroundColor) &&
|
||||
ReadContentDescription(aMsg, aIter, aResult) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mLineScrollAmount) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mPageScrollAmount) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mPaintRequestTime) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mScrollUpdateType) &&
|
||||
ReadBoolForBitfield(aMsg, aIter, aResult, ¶mType::SetIsRootContent) &&
|
||||
ReadBoolForBitfield(aMsg, aIter, aResult, ¶mType::SetHasScrollgrab) &&
|
||||
ReadBoolForBitfield(aMsg, aIter, aResult, ¶mType::SetDoSmoothScroll) &&
|
||||
ReadBoolForBitfield(aMsg, aIter, aResult, ¶mType::SetUseDisplayPortMargins) &&
|
||||
ReadBoolForBitfield(aMsg, aIter, aResult, ¶mType::SetAllowVerticalScrollWithWheel) &&
|
||||
ReadBoolForBitfield(aMsg, aIter, aResult, ¶mType::SetIsLayersIdRoot) &&
|
||||
ReadBoolForBitfield(aMsg, aIter, aResult, ¶mType::SetUsesContainerScrolling) &&
|
||||
ReadBoolForBitfield(aMsg, aIter, aResult, ¶mType::SetIsScrollInfoLayer) &&
|
||||
ReadBoolForBitfield(aMsg, aIter, aResult, ¶mType::SetForceDisableApz));
|
||||
ReadBoolForBitfield(aMsg, aIter, aResult, ¶mType::SetIsScrollInfoLayer));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -814,6 +791,7 @@ struct ParamTraits<mozilla::layers::ScrollSnapInfo>
|
||||
|
||||
template <>
|
||||
struct ParamTraits<mozilla::layers::ScrollMetadata>
|
||||
: BitfieldHelper<mozilla::layers::ScrollMetadata>
|
||||
{
|
||||
typedef mozilla::layers::ScrollMetadata paramType;
|
||||
|
||||
@@ -821,16 +799,46 @@ struct ParamTraits<mozilla::layers::ScrollMetadata>
|
||||
{
|
||||
WriteParam(aMsg, aParam.mMetrics);
|
||||
WriteParam(aMsg, aParam.mSnapInfo);
|
||||
WriteParam(aMsg, aParam.mScrollParentId);
|
||||
WriteParam(aMsg, aParam.mBackgroundColor);
|
||||
WriteParam(aMsg, aParam.GetContentDescription());
|
||||
WriteParam(aMsg, aParam.mLineScrollAmount);
|
||||
WriteParam(aMsg, aParam.mPageScrollAmount);
|
||||
WriteParam(aMsg, aParam.mMaskLayerIndex);
|
||||
WriteParam(aMsg, aParam.mClipRect);
|
||||
WriteParam(aMsg, aParam.mHasScrollgrab);
|
||||
WriteParam(aMsg, aParam.mAllowVerticalScrollWithWheel);
|
||||
WriteParam(aMsg, aParam.mIsLayersIdRoot);
|
||||
WriteParam(aMsg, aParam.mUsesContainerScrolling);
|
||||
WriteParam(aMsg, aParam.mForceDisableApz);
|
||||
}
|
||||
|
||||
static bool ReadContentDescription(const Message* aMsg, void** aIter, paramType* aResult)
|
||||
{
|
||||
nsCString str;
|
||||
if (!ReadParam(aMsg, aIter, &str)) {
|
||||
return false;
|
||||
}
|
||||
aResult->SetContentDescription(str);
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
||||
{
|
||||
return (ReadParam(aMsg, aIter, &aResult->mMetrics) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mSnapInfo) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mScrollParentId) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mBackgroundColor) &&
|
||||
ReadContentDescription(aMsg, aIter, aResult) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mLineScrollAmount) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mPageScrollAmount) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mMaskLayerIndex) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mClipRect));
|
||||
ReadParam(aMsg, aIter, &aResult->mClipRect) &&
|
||||
ReadBoolForBitfield(aMsg, aIter, aResult, ¶mType::SetHasScrollgrab) &&
|
||||
ReadBoolForBitfield(aMsg, aIter, aResult, ¶mType::SetAllowVerticalScrollWithWheel) &&
|
||||
ReadBoolForBitfield(aMsg, aIter, aResult, ¶mType::SetIsLayersIdRoot) &&
|
||||
ReadBoolForBitfield(aMsg, aIter, aResult, ¶mType::SetUsesContainerScrolling) &&
|
||||
ReadBoolForBitfield(aMsg, aIter, aResult, ¶mType::SetForceDisableApz));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace layers {
|
||||
const FrameMetrics::ViewID FrameMetrics::NULL_SCROLL_ID = 0;
|
||||
|
||||
void
|
||||
FrameMetrics::SetUsesContainerScrolling(bool aValue) {
|
||||
ScrollMetadata::SetUsesContainerScrolling(bool aValue) {
|
||||
MOZ_ASSERT_IF(aValue, gfxPrefs::LayoutUseContainersForRootFrames());
|
||||
mUsesContainerScrolling = aValue;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user