diff --git a/b2g/app/b2g.js b/b2g/app/b2g.js index 4546b9aa904..56cb9612cfc 100644 --- a/b2g/app/b2g.js +++ b/b2g/app/b2g.js @@ -1078,6 +1078,13 @@ pref("dom.mozSettings.allowForceReadOnly", false); // RequestSync API is enabled by default on B2G. pref("dom.requestSync.enabled", true); -// Enable hardware vsync compositor +// Only enable for kit kat and above devices +// kit kat == 19, L = 21, 20 is kit-kat for wearables +// 15 is for the ICS emulators which will fallback to software vsync +#if ANDROID_VERSION == 19 || ANDROID_VERSION == 21 || ANDROID_VERSION == 15 pref("gfx.vsync.hw-vsync.enabled", true); pref("gfx.vsync.compositor", true); +#else +pref("gfx.vsync.hw-vsync.enabled", false); +pref("gfx.vsync.compositor", false); +#endif diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 591762709d7..f7d617e0e76 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 5281141a4be..9c70f5c2ff1 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 9ed035d77ce..b4f731ba459 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 65e88ba631a..296a75bdcdb 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 5281141a4be..9c70f5c2ff1 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index 50987628577..081a8cd6ec0 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 41552254402..240907a428a 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 1b49e38c6b6..f69ca01495c 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -1,9 +1,9 @@ { "git": { - "git_revision": "ba613ae583a706131c45e885f65d428d4a541a81", + "git_revision": "782d371263911a526870263bffcb419b52c7c88a", "remote": "https://git.mozilla.org/releases/gaia.git", "branch": "" }, - "revision": "4705c493adb5c766382b27e4fbff42f7447900e9", + "revision": "8c97eed028b3ad9580854e6c12f80e3046440e45", "repo_path": "integration/gaia-central" } diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index fcae1834913..af76ae21035 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 81562ebef1f..9f04158d310 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 6b3ba21fa26..8a0dd6ee7f2 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index cfe4afd1e97..f5ee217b909 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/browser/components/feeds/FeedConverter.js b/browser/components/feeds/FeedConverter.js index de9e6a2d956..e7c2d8439d9 100644 --- a/browser/components/feeds/FeedConverter.js +++ b/browser/components/feeds/FeedConverter.js @@ -235,6 +235,11 @@ FeedConverter.prototype = { getService(Ci.nsIIOService); var chromeChannel; + // handling a redirect, hence forwarding the loadInfo from the old channel + // to the newchannel. + var oldChannel = this._request.QueryInterface(Ci.nsIChannel); + var loadInfo = oldChannel.loadInfo; + // If there was no automatic handler, or this was a podcast, // photostream or some other kind of application, show the preview page // if the parser returned a document. @@ -246,12 +251,12 @@ FeedConverter.prototype = { // Now load the actual XUL document. var aboutFeedsURI = ios.newURI("about:feeds", null, null); - chromeChannel = ios.newChannelFromURI(aboutFeedsURI, null); + chromeChannel = ios.newChannelFromURIWithLoadInfo(aboutFeedsURI, loadInfo); chromeChannel.originalURI = result.uri; chromeChannel.owner = Services.scriptSecurityManager.getNoAppCodebasePrincipal(aboutFeedsURI); } else { - chromeChannel = ios.newChannelFromURI(result.uri, null); + chromeChannel = ios.newChannelFromURIWithLoadInfo(result.uri, loadInfo); } chromeChannel.loadGroup = this._request.loadGroup; @@ -546,7 +551,12 @@ GenericProtocolHandler.prototype = { newChannel: function GPH_newChannel(aUri) { var inner = aUri.QueryInterface(Ci.nsINestedURI).innerURI; var channel = Cc["@mozilla.org/network/io-service;1"]. - getService(Ci.nsIIOService).newChannelFromURI(inner, null); + getService(Ci.nsIIOService).newChannelFromURI2(inner, + null, // aLoadingNode + Services.scriptSecurityManager.getSystemPrincipal(), + null, // aTriggeringPrincipal + Ci.nsILoadInfo.SEC_NORMAL, + Ci.nsIContentPolicy.TYPE_OTHER); if (channel instanceof Components.interfaces.nsIHttpChannel) // Set this so we know this is supposed to be a feed channel.setRequestHeader("X-Moz-Is-Feed", "1", false); diff --git a/browser/components/feeds/FeedWriter.js b/browser/components/feeds/FeedWriter.js index 7e2080f918a..33916676a2e 100644 --- a/browser/components/feeds/FeedWriter.js +++ b/browser/components/feeds/FeedWriter.js @@ -1128,9 +1128,19 @@ FeedWriter.prototype = { getInterface(Ci.nsIWebNavigation). QueryInterface(Ci.nsIDocShell).currentDocumentChannel; + var nullPrincipal = Cc["@mozilla.org/nullprincipal;1"]. + createInstance(Ci.nsIPrincipal); + var resolvedURI = Cc["@mozilla.org/network/io-service;1"]. getService(Ci.nsIIOService). - newChannel("about:feeds", null, null).URI; + newChannel2("about:feeds", + null, + null, + null, // aLoadingNode + nullPrincipal, + null, // aTriggeringPrincipal + Ci.nsILoadInfo.SEC_NORMAL, + Ci.nsIContentPolicy.TYPE_OTHER).URI; if (resolvedURI.equals(chan.URI)) return chan.originalURI; diff --git a/browser/config/tooltool-manifests/win64/releng.manifest b/browser/config/tooltool-manifests/win64/releng.manifest index 2e802b78d1f..97eb0b36012 100644 --- a/browser/config/tooltool-manifests/win64/releng.manifest +++ b/browser/config/tooltool-manifests/win64/releng.manifest @@ -4,5 +4,17 @@ "digest": "bb345b0e700ffab4d09436981f14b5de84da55a3f18a7f09ebc4364a4488acdeab8d46f447b12ac70f2da1444a68b8ce8b8675f0dae2ccf845e966d1df0f0869", "algorithm": "sha512", "filename": "mozmake.exe" +}, +{ +"size": 176, +"digest": "2809058907ac5eefdc394113d2e4fe76ba559ac61c2eca2f88e7a12a74bdf44a15d9039fa8aa229f7362a14b67d67395063f68147ae098beac5dfcc78aff98da", +"algorithm": "sha512", +"filename": "setup.sh" +}, +{ +"size": 166506, +"digest": "f3c214fd571f21d64937584645212f8d7c2d12c9016be613bd2bc9cecd80b3d52a741423cc1ca69bd85fb924c3d0572c85a1734d12db1616df37abcc397e9252", +"algorithm": "sha512", +"filename": "sccache.tar.bz2" } ] diff --git a/browser/devtools/webconsole/console-output.js b/browser/devtools/webconsole/console-output.js index 0e4fc289056..5971deb8ff9 100644 --- a/browser/devtools/webconsole/console-output.js +++ b/browser/devtools/webconsole/console-output.js @@ -896,13 +896,16 @@ Messages.Simple.prototype = Heritage.extend(Messages.BaseMessage.prototype, let body = this.document.createElementNS(XHTML_NS, "span"); body.className = "message-body-wrapper message-body devtools-monospace"; - let anchor, container = body; + let bodyInner = this.document.createElementNS(XHTML_NS, "span"); + body.appendChild(bodyInner); + + let anchor, container = bodyInner; if (this._link || this._linkCallback) { container = anchor = this.document.createElementNS(XHTML_NS, "a"); anchor.href = this._link || "#"; anchor.draggable = false; this._addLinkCallback(anchor, this._linkCallback); - body.appendChild(anchor); + bodyInner.appendChild(anchor); } if (typeof this._message == "function") { diff --git a/browser/devtools/webconsole/test/browser_webconsole_bug_587617_output_copy.js b/browser/devtools/webconsole/test/browser_webconsole_bug_587617_output_copy.js index e3b0d21d1e5..78a4221c4c2 100644 --- a/browser/devtools/webconsole/test/browser_webconsole_bug_587617_output_copy.js +++ b/browser/devtools/webconsole/test/browser_webconsole_bug_587617_output_copy.js @@ -57,7 +57,9 @@ function consoleOpened(aHud) { controller = top.document.commandDispatcher.getControllerForCommand("cmd_copy"); is(controller.isCommandEnabled("cmd_copy"), true, "cmd_copy is enabled"); - let selection = HUD.iframeWindow.getSelection() + ""; + // Remove new lines since getSelection() includes one between message and line + // number, but the clipboard doesn't (see bug 1119503) + let selection = (HUD.iframeWindow.getSelection() + "").replace(/\r?\n|\r/g, " "); isnot(selection.indexOf("bug587617"), -1, "selection text includes 'bug587617'"); @@ -80,7 +82,9 @@ function testContextMenuCopy() { let copyItem = contextMenu.querySelector("*[command='cmd_copy']"); ok(copyItem, "the context menu on the output node has a \"Copy\" item"); - let selection = HUD.iframeWindow.getSelection() + ""; + // Remove new lines since getSelection() includes one between message and line + // number, but the clipboard doesn't (see bug 1119503) + let selection = (HUD.iframeWindow.getSelection() + "").replace(/\r?\n|\r/g, " "); copyItem.doCommand(); diff --git a/browser/devtools/webconsole/test/browser_webconsole_bug_613280_jsterm_copy.js b/browser/devtools/webconsole/test/browser_webconsole_bug_613280_jsterm_copy.js index e5d77b1e302..d35559ab5c1 100644 --- a/browser/devtools/webconsole/test/browser_webconsole_bug_613280_jsterm_copy.js +++ b/browser/devtools/webconsole/test/browser_webconsole_bug_613280_jsterm_copy.js @@ -69,7 +69,9 @@ function performTest(HUD, [result]) { getControllerForCommand("cmd_copy"); is(controller.isCommandEnabled("cmd_copy"), true, "cmd_copy is enabled"); - let selectionText = HUD.iframeWindow.getSelection() + ""; + // Remove new lines since getSelection() includes one between message and line + // number, but the clipboard doesn't (see bug 1119503) + let selectionText = (HUD.iframeWindow.getSelection() + "").replace(/\r?\n|\r/g, " "); isnot(selectionText.indexOf("foobarBazBug613280"), -1, "selection text includes 'foobarBazBug613280'"); diff --git a/browser/themes/shared/devtools/webconsole.inc.css b/browser/themes/shared/devtools/webconsole.inc.css index f2010450c66..a97e01cc2d8 100644 --- a/browser/themes/shared/devtools/webconsole.inc.css +++ b/browser/themes/shared/devtools/webconsole.inc.css @@ -117,7 +117,7 @@ a { display: flex; } -.message-body { +.message-body > * { white-space: pre-wrap; word-wrap: break-word; } diff --git a/browser/themes/windows/browser.css b/browser/themes/windows/browser.css index e7cf59c91d3..204c3925747 100644 --- a/browser/themes/windows/browser.css +++ b/browser/themes/windows/browser.css @@ -753,7 +753,7 @@ toolbarbutton[sdk-button="true"][cui-areatype="toolbar"] > .toolbarbutton-icon { } #nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-button > .toolbarbutton-icon { - -moz-border-end: none; + -moz-border-end: none transparent; } #nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon { diff --git a/dom/base/nsCopySupport.cpp b/dom/base/nsCopySupport.cpp index 56ac20eb145..3f6db3928da 100644 --- a/dom/base/nsCopySupport.cpp +++ b/dom/base/nsCopySupport.cpp @@ -97,7 +97,8 @@ SelectionCopyHelper(nsISelection *aSel, nsIDocument *aDoc, // Do the first and potentially trial encoding as preformatted and raw. uint32_t flags = aFlags | nsIDocumentEncoder::OutputPreformatted - | nsIDocumentEncoder::OutputRaw; + | nsIDocumentEncoder::OutputRaw + | nsIDocumentEncoder::OutputForPlainTextClipboardCopy; nsCOMPtr domDoc = do_QueryInterface(aDoc); NS_ASSERTION(domDoc, "Need a document"); diff --git a/dom/base/nsDOMWindowUtils.cpp b/dom/base/nsDOMWindowUtils.cpp index 95f7d88e550..c78d9d39dc6 100644 --- a/dom/base/nsDOMWindowUtils.cpp +++ b/dom/base/nsDOMWindowUtils.cpp @@ -1220,8 +1220,7 @@ nsDOMWindowUtils::SendKeyEvent(const nsAString& aType, uint32_t locationFlag = (aAdditionalFlags & (KEY_FLAG_LOCATION_STANDARD | KEY_FLAG_LOCATION_LEFT | - KEY_FLAG_LOCATION_RIGHT | KEY_FLAG_LOCATION_NUMPAD | - KEY_FLAG_LOCATION_MOBILE | KEY_FLAG_LOCATION_JOYSTICK)); + KEY_FLAG_LOCATION_RIGHT | KEY_FLAG_LOCATION_NUMPAD)); switch (locationFlag) { case KEY_FLAG_LOCATION_STANDARD: event.location = nsIDOMKeyEvent::DOM_KEY_LOCATION_STANDARD; @@ -1235,12 +1234,6 @@ nsDOMWindowUtils::SendKeyEvent(const nsAString& aType, case KEY_FLAG_LOCATION_NUMPAD: event.location = nsIDOMKeyEvent::DOM_KEY_LOCATION_NUMPAD; break; - case KEY_FLAG_LOCATION_MOBILE: - event.location = nsIDOMKeyEvent::DOM_KEY_LOCATION_MOBILE; - break; - case KEY_FLAG_LOCATION_JOYSTICK: - event.location = nsIDOMKeyEvent::DOM_KEY_LOCATION_JOYSTICK; - break; default: if (locationFlag != 0) { return NS_ERROR_INVALID_ARG; diff --git a/dom/base/nsIDocumentEncoder.idl b/dom/base/nsIDocumentEncoder.idl index b5963bb2db8..155e5c375c6 100644 --- a/dom/base/nsIDocumentEncoder.idl +++ b/dom/base/nsIDocumentEncoder.idl @@ -227,6 +227,13 @@ interface nsIDocumentEncoder : nsISupports */ const unsigned long OutputDontRemoveLineEndingSpaces = (1 << 24); + /** + * Serialize in a way that is suitable for copying a plaintext version of the + * document to the clipboard. This can for example cause line endings to be + * injected at preformatted block element boundaries. + */ + const unsigned long OutputForPlainTextClipboardCopy = (1 << 25); + /** * Initialize with a pointer to the document and the mime type. * @param aDocument Document to encode. diff --git a/dom/base/nsPlainTextSerializer.cpp b/dom/base/nsPlainTextSerializer.cpp index be3a3b26e96..eb7e4b1cff4 100644 --- a/dom/base/nsPlainTextSerializer.cpp +++ b/dom/base/nsPlainTextSerializer.cpp @@ -91,6 +91,8 @@ nsPlainTextSerializer::nsPlainTextSerializer() mPreFormatted = false; mStartedOutput = false; + mPreformattedBlockBoundary = false; + // initialize the tag stack to zero: // The stack only ever contains pointers to static atoms, so they don't // need refcounting. @@ -167,6 +169,8 @@ nsPlainTextSerializer::Init(uint32_t aFlags, uint32_t aWrapColumn, mLineBreakDue = false; mFloatingLines = -1; + mPreformattedBlockBoundary = false; + if (mFlags & nsIDocumentEncoder::OutputFormatted) { // Get some prefs that controls how we do formatted output mStructs = Preferences::GetBool(PREF_STRUCTS, mStructs); @@ -437,6 +441,16 @@ nsPlainTextSerializer::DoOpenContainer(nsIAtom* aTag) return NS_OK; } + if (mFlags & nsIDocumentEncoder::OutputForPlainTextClipboardCopy) { + if (mPreformattedBlockBoundary && DoOutput()) { + // Should always end a line, but get no more whitespace + if (mFloatingLines < 0) + mFloatingLines = 0; + mLineBreakDue = true; + } + mPreformattedBlockBoundary = false; + } + if (mFlags & nsIDocumentEncoder::OutputRaw) { // Raw means raw. Don't even think about doing anything fancy // here like indenting, adding line breaks or any other @@ -670,7 +684,7 @@ nsPlainTextSerializer::DoOpenContainer(nsIAtom* aTag) // Else make sure we'll separate block level tags, // even if we're about to leave, before doing any other formatting. - else if (nsContentUtils::IsHTMLBlock(aTag)) { + else if (IsElementBlock(mElement)) { EnsureVerticalSpace(0); } @@ -767,6 +781,14 @@ nsPlainTextSerializer::DoCloseContainer(nsIAtom* aTag) return NS_OK; } + if (mFlags & nsIDocumentEncoder::OutputForPlainTextClipboardCopy) { + if (DoOutput() && IsInPre() && IsElementBlock(mElement)) { + // If we're closing a preformatted block element, output a line break + // when we find a new container. + mPreformattedBlockBoundary = true; + } + } + if (mFlags & nsIDocumentEncoder::OutputRaw) { // Raw means raw. Don't even think about doing anything fancy // here like indenting, adding line breaks or any other @@ -887,8 +909,7 @@ nsPlainTextSerializer::DoCloseContainer(nsIAtom* aTag) else if (aTag == nsGkAtoms::q) { Write(NS_LITERAL_STRING("\"")); } - else if (nsContentUtils::IsHTMLBlock(aTag) - && aTag != nsGkAtoms::script) { + else if (IsElementBlock(mElement) && aTag != nsGkAtoms::script) { // All other blocks get 1 vertical space after them // in formatted mode, otherwise 0. // This is hard. Sometimes 0 is a better number, but @@ -1037,6 +1058,8 @@ nsPlainTextSerializer::DoAddText(bool aIsLineBreak, const nsAString& aText) nsresult nsPlainTextSerializer::DoAddLeaf(nsIAtom* aTag) { + mPreformattedBlockBoundary = false; + // If we don't want any output, just return if (!DoOutput()) { return NS_OK; @@ -1778,6 +1801,20 @@ nsPlainTextSerializer::IsElementPreformatted(Element* aElement) return GetIdForContent(aElement) == nsGkAtoms::pre; } +bool +nsPlainTextSerializer::IsElementBlock(Element* aElement) +{ + nsRefPtr styleContext = + nsComputedDOMStyle::GetStyleContextForElementNoFlush(aElement, nullptr, + nullptr); + if (styleContext) { + const nsStyleDisplay* displayStyle = styleContext->StyleDisplay(); + return displayStyle->IsBlockOutsideStyle(); + } + // Fall back to looking at the tag, in case there is no style information. + return nsContentUtils::IsHTMLBlock(GetIdForContent(aElement)); +} + /** * This method is required only to identify LI's inside OL. * Returns TRUE if we are inside an OL tag and FALSE otherwise. diff --git a/dom/base/nsPlainTextSerializer.h b/dom/base/nsPlainTextSerializer.h index 479272a76ad..9535a59d9d5 100644 --- a/dom/base/nsPlainTextSerializer.h +++ b/dom/base/nsPlainTextSerializer.h @@ -115,6 +115,7 @@ private: bool ShouldReplaceContainerWithPlaceholder(nsIAtom* aTag); bool IsElementPreformatted(mozilla::dom::Element* aElement); + bool IsElementBlock(mozilla::dom::Element* aElement); private: nsString mCurrentLine; @@ -169,7 +170,9 @@ private: // While handling a new tag, this variable should remind if any line break // is due because of a closing tag. Setting it to "TRUE" while closing the tags. // Hence opening tags are guaranteed to start with appropriate line breaks. - bool mLineBreakDue; + bool mLineBreakDue; + + bool mPreformattedBlockBoundary; nsString mURL; int32_t mHeaderStrategy; /* Header strategy (pref) diff --git a/dom/base/test/TestPlainTextSerializer.cpp b/dom/base/test/TestPlainTextSerializer.cpp index 7be9bce0fda..b1a7f241350 100644 --- a/dom/base/test/TestPlainTextSerializer.cpp +++ b/dom/base/test/TestPlainTextSerializer.cpp @@ -137,6 +137,31 @@ TestPreElement() return NS_OK; } +nsresult +TestBlockElement() +{ + nsString test; + test.AppendLiteral( + "" NS_LINEBREAK + "" NS_LINEBREAK + "
" NS_LINEBREAK + " first" NS_LINEBREAK + "
" NS_LINEBREAK + "
" NS_LINEBREAK + " second" NS_LINEBREAK + "
" NS_LINEBREAK + "" NS_LINEBREAK ""); + + ConvertBufToPlainText(test, 0); + if (!test.EqualsLiteral("first" NS_LINEBREAK "second" NS_LINEBREAK)) { + fail("Wrong prettyprinted html to text serialization"); + return NS_ERROR_FAILURE; + } + + passed("prettyprinted HTML to text serialization test"); + return NS_OK; +} + nsresult TestPlainTextSerializer() { @@ -163,6 +188,9 @@ TestPlainTextSerializer() rv = TestPreElement(); NS_ENSURE_SUCCESS(rv, rv); + rv = TestBlockElement(); + NS_ENSURE_SUCCESS(rv, rv); + // Add new tests here... return NS_OK; } diff --git a/dom/base/test/test_bug116083.html b/dom/base/test/test_bug116083.html index 4244a13aef6..5ac1181536e 100644 --- a/dom/base/test/test_bug116083.html +++ b/dom/base/test/test_bug116083.html @@ -20,6 +20,14 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=116083
bar baz
bar baz
bar baz
+
foo
bar

!


baz
+
foo
bar

!


baz
+
foo
bar

!


baz
+
foo
bar

!


baz
+
foo
bar

!


baz
+
foo
bar

!


baz
+
foo
bar

!


baz
+
foo
bar

!


baz
foo bar