Backed out 6 changesets (bug 1525662, bug 1501665) for geckoview failures at org.mozilla.geckoview.test.NavigationDelegateTest.loadData_noMimeType. CLOSED TREE
authorBrindusan Cristian <cbrindusan@mozilla.com>
Tue, 05 Mar 2019 23:42:55 +0200
changeset 520320 10f3bcf2a0ed1a35764e8ac1a48d76042ba1ef78
parent 520319 a59527dafca1d132facf8830c35cf1239ab7f0c2
child 520321 5c6fc3df47377fcdc94d51861b4f3fa9a70acfdc
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1525662, 1501665
milestone67.0a1
backs out1fa7091b4b4eb5d57319894a09728bd435136cb0
32249c69fee9c516735e98805141c073750b107f
aaa8fbdbbe48b39e1323f1b0bd741a537b45b860
f07e25fac5b20976178fb2e4dd7f95a6e252207a
a8ec11730706c4e34b66e19dc0d365ca5caec379
159753062cfa8b9a00885b4879bd5f22157c5280
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out 6 changesets (bug 1525662, bug 1501665) for geckoview failures at org.mozilla.geckoview.test.NavigationDelegateTest.loadData_noMimeType. CLOSED TREE Backed out changeset 1fa7091b4b4e (bug 1525662) Backed out changeset 32249c69fee9 (bug 1525662) Backed out changeset aaa8fbdbbe48 (bug 1525662) Backed out changeset f07e25fac5b2 (bug 1525662) Backed out changeset a8ec11730706 (bug 1525662) Backed out changeset 159753062cfa (bug 1501665)
dom/base/Document.cpp
dom/base/Document.h
dom/base/test/reftest/reftest.list
dom/base/test/reftest/test_bug1525662-ref.html
dom/base/test/reftest/test_bug1525662.txt
dom/html/nsHTMLDocument.cpp
dom/html/nsHTMLDocument.h
mobile/android/app/mobile.js
--- a/dom/base/Document.cpp
+++ b/dom/base/Document.cpp
@@ -6476,18 +6476,16 @@ nsINode* Document::AdoptNode(nsINode& aA
   }
 
   NS_ASSERTION(adoptedNode->OwnerDoc() == this,
                "Should still be in the document we just got adopted into");
 
   return adoptedNode;
 }
 
-bool Document::UseWidthDeviceWidthFallbackViewport() const { return false; }
-
 void Document::ParseWidthAndHeightInMetaViewport(
     const nsAString& aWidthString, const nsAString& aHeightString,
     const nsAString& aScaleString) {
   // The width and height properties
   // https://drafts.csswg.org/css-device-adapt/#width-and-height-properties
   //
   // The width and height viewport <META> properties are translated into width
   // and height descriptors, setting the min-width/min-height value to
@@ -6517,19 +6515,16 @@ void Document::ParseWidthAndHeightInMeta
       }
     }
     // FIXME: Check the scale is not 'auto' once we support auto value for it.
   } else if (!aScaleString.IsEmpty()) {
     if (aHeightString.IsEmpty()) {
       mMinWidth = nsViewportInfo::ExtendToZoom;
       mMaxWidth = nsViewportInfo::ExtendToZoom;
     }
-  } else if (aHeightString.IsEmpty() && UseWidthDeviceWidthFallbackViewport()) {
-    mMinWidth = nsViewportInfo::ExtendToZoom;
-    mMaxWidth = nsViewportInfo::DeviceSize;
   }
 
   mMinHeight = nsViewportInfo::Auto;
   mMaxHeight = nsViewportInfo::Auto;
   if (!aHeightString.IsEmpty()) {
     mMinHeight = nsViewportInfo::ExtendToZoom;
     if (aHeightString.EqualsLiteral("device-height")) {
       mMaxHeight = nsViewportInfo::DeviceSize;
@@ -6792,26 +6787,18 @@ nsViewportInfo Document::GetViewportInfo
         height = nsViewportInfo::Max(
             minHeight, nsViewportInfo::Min(maxHeight, displaySize.height));
       }
 
       // Resolve width value
       // https://drafts.csswg.org/css-device-adapt/#resolve-width
       if (width == nsViewportInfo::Auto) {
         if (height == nsViewportInfo::Auto || aDisplaySize.height == 0) {
-          // If we don't have any applicable viewport width constraints, this is
-          // most likely a desktop page written without mobile devices in mind.
-          // We use the desktop mode viewport for those pages by default,
-          // because a narrow viewport based on typical mobile device screen
-          // sizes (especially in portrait mode) will frequently break the
-          // layout of such pages. To keep text readable in that case, we rely
-          // on font inflation instead.
-
-          // Divide by fullZoom to stretch CSS pixel size of viewport in order
-          // to keep device pixel size unchanged after full zoom applied.
+          // Stretch CSS pixel size of viewport to keep device pixel size
+          // unchanged after full zoom applied.
           // See bug 974242.
           width = gfxPrefs::DesktopViewportWidth() / fullZoom;
         } else {
           width = height * aDisplaySize.width / aDisplaySize.height;
         }
       }
 
       // Resolve height value
--- a/dom/base/Document.h
+++ b/dom/base/Document.h
@@ -3595,23 +3595,16 @@ class Document : public nsINode,
    * This method is virtual so that XULDocument can
    * override it.
    */
   virtual void InitialDocumentTranslationCompleted();
 
  protected:
   RefPtr<mozilla::dom::DocumentL10n> mDocumentL10n;
 
-  /**
-   * Return true when you want a document without explicitly specified viewport
-   * dimensions/scale to be treated as if "width=device-width" had in fact been
-   * specified.
-   */
-  virtual bool UseWidthDeviceWidthFallbackViewport() const;
-
  private:
   void InitializeLocalization(nsTArray<nsString>& aResourceIds);
 
   void ParseWidthAndHeightInMetaViewport(const nsAString& aWidthString,
                                          const nsAString& aHeightString,
                                          const nsAString& aScaleString);
 
   mozilla::dom::FlashClassification DocumentFlashClassificationInternal();
--- a/dom/base/test/reftest/reftest.list
+++ b/dom/base/test/reftest/reftest.list
@@ -1,7 +1,2 @@
 == test_bug920877.html test_bug920877-ref.html
 HTTP == test_xmlPrettyPrint_csp.xml test_xmlPrettyPrint_csp-ref.xml
-# Ordinarily, reftests use a browser.viewport.desktopWidth of 800px, same as the
-# size of the reftest document. This test however needs something more representative
-# of a real mobile device, where the desktop viewport width doesn't match the
-# width of the device screen.
-test-pref(dom.meta-viewport.enabled,true) test-pref(browser.viewport.desktopWidth,1200) test-pref(plain_text.wrap_long_lines,true) == test_bug1525662.txt test_bug1525662-ref.html
deleted file mode 100644
--- a/dom/base/test/reftest/test_bug1525662-ref.html
+++ /dev/null
@@ -1,15 +0,0 @@
-<html>
-<head>
-<meta name="viewport" content="width=device-width">
-</head>
-<body>
-<pre style="white-space: pre-wrap; word-wrap: break-word">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras ac velit sed tellus facilisis euismod. Proin vel nulla vel turpis tristique dignissim. Donec lacus ipsum, eleifend ut, volutpat a, ultrices adipiscing, arcu. Etiam ligula dolor, adipiscing ut, porta vitae, bibendum non, dolor. Mauris ligula. Sed placerat tincidunt elit. Vestibulum non libero. Curabitur cursus tortor id sem. Integer consectetuer auctor lacus. Proin nisl nisi, pulvinar eget, pharetra at, aliquam eu, velit. Morbi fringilla. Quisque faucibus, mauris posuere vulputate interdum, lectus libero sollicitudin tellus, sit amet ultrices enim purus ac mauris. Pellentesque sit amet mauris eu ante aliquet egestas. Mauris dapibus, velit consectetuer tristique luctus, enim augue pulvinar libero, fringilla dictum lectus felis eu ligula. In ac lorem.
-
-Integer laoreet. Ut ultricies arcu nec est. Aenean varius nisl ut odio. Nullam arcu. Vestibulum non pede. Proin vel est. Nam condimentum fermentum dui. Donec at arcu. Donec at libero adipiscing odio mattis dapibus. Suspendisse libero neque, faucibus sed, facilisis et, convallis sit amet, justo. Duis purus tortor, ornare ac, convallis ut, pretium et, tellus. Nam accumsan, ipsum eget accumsan mollis, sapien dolor adipiscing metus, id tincidunt ipsum metus sed nulla. Praesent hendrerit lectus eget tortor. Morbi id lectus et elit ultrices hendrerit. Cras gravida velit sed mauris. Proin lacinia tempus est. Sed sapien tortor, fringilla vel, elementum in, volutpat ac, ante. Vivamus eu tellus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;
-
-Mauris in sem ac felis pretium placerat. Donec tempus cursus sem. Aliquam scelerisque porttitor sem. Curabitur consectetuer, pede vitae aliquam aliquet, sapien lacus vehicula neque, ut rhoncus nibh neque sed velit. In rhoncus, nulla eu dignissim egestas, diam nibh hendrerit mauris, condimentum laoreet sapien arcu quis mi. Sed euismod sem. Nulla non ligula sed lacus tempor molestie. Quisque varius. In hac habitasse platea dictumst. Sed felis ipsum, consequat et, blandit vitae, tincidunt id, quam. Nunc nunc. Duis gravida. In massa neque, cursus quis, rutrum sed, semper quis, erat. Donec enim. Suspendisse condimentum eros vel elit. Vestibulum adipiscing erat id lorem. Maecenas enim dui, cursus a, pulvinar ac, rutrum sed, sem. Suspendisse gravida ante vel lectus.
-
-Vestibulum molestie, ante at dignissim venenatis, pede urna dictum arcu, vel ullamcorper ligula eros eget metus. Pellentesque nec nisl. Morbi ut nibh. Aenean mauris. Mauris rutrum justo nec velit. Nunc condimentum tortor id augue. Quisque semper massa eget nibh. Maecenas ac odio pretium lorem tincidunt faucibus. Sed congue. Cras sit amet orci ut ligula cursus congue. Etiam laoreet lacus sit amet tortor. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vivamus accumsan. Ut gravida urna hendrerit leo. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
-</pre>
-</body>
-</html>
deleted file mode 100644
--- a/dom/base/test/reftest/test_bug1525662.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras ac velit sed tellus facilisis euismod. Proin vel nulla vel turpis tristique dignissim. Donec lacus ipsum, eleifend ut, volutpat a, ultrices adipiscing, arcu. Etiam ligula dolor, adipiscing ut, porta vitae, bibendum non, dolor. Mauris ligula. Sed placerat tincidunt elit. Vestibulum non libero. Curabitur cursus tortor id sem. Integer consectetuer auctor lacus. Proin nisl nisi, pulvinar eget, pharetra at, aliquam eu, velit. Morbi fringilla. Quisque faucibus, mauris posuere vulputate interdum, lectus libero sollicitudin tellus, sit amet ultrices enim purus ac mauris. Pellentesque sit amet mauris eu ante aliquet egestas. Mauris dapibus, velit consectetuer tristique luctus, enim augue pulvinar libero, fringilla dictum lectus felis eu ligula. In ac lorem.
-
-Integer laoreet. Ut ultricies arcu nec est. Aenean varius nisl ut odio. Nullam arcu. Vestibulum non pede. Proin vel est. Nam condimentum fermentum dui. Donec at arcu. Donec at libero adipiscing odio mattis dapibus. Suspendisse libero neque, faucibus sed, facilisis et, convallis sit amet, justo. Duis purus tortor, ornare ac, convallis ut, pretium et, tellus. Nam accumsan, ipsum eget accumsan mollis, sapien dolor adipiscing metus, id tincidunt ipsum metus sed nulla. Praesent hendrerit lectus eget tortor. Morbi id lectus et elit ultrices hendrerit. Cras gravida velit sed mauris. Proin lacinia tempus est. Sed sapien tortor, fringilla vel, elementum in, volutpat ac, ante. Vivamus eu tellus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;
-
-Mauris in sem ac felis pretium placerat. Donec tempus cursus sem. Aliquam scelerisque porttitor sem. Curabitur consectetuer, pede vitae aliquam aliquet, sapien lacus vehicula neque, ut rhoncus nibh neque sed velit. In rhoncus, nulla eu dignissim egestas, diam nibh hendrerit mauris, condimentum laoreet sapien arcu quis mi. Sed euismod sem. Nulla non ligula sed lacus tempor molestie. Quisque varius. In hac habitasse platea dictumst. Sed felis ipsum, consequat et, blandit vitae, tincidunt id, quam. Nunc nunc. Duis gravida. In massa neque, cursus quis, rutrum sed, semper quis, erat. Donec enim. Suspendisse condimentum eros vel elit. Vestibulum adipiscing erat id lorem. Maecenas enim dui, cursus a, pulvinar ac, rutrum sed, sem. Suspendisse gravida ante vel lectus.
-
-Vestibulum molestie, ante at dignissim venenatis, pede urna dictum arcu, vel ullamcorper ligula eros eget metus. Pellentesque nec nisl. Morbi ut nibh. Aenean mauris. Mauris rutrum justo nec velit. Nunc condimentum tortor id augue. Quisque semper massa eget nibh. Maecenas ac odio pretium lorem tincidunt faucibus. Sed congue. Cras sit amet orci ut ligula cursus congue. Etiam laoreet lacus sit amet tortor. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vivamus accumsan. Ut gravida urna hendrerit leo. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
--- a/dom/html/nsHTMLDocument.cpp
+++ b/dom/html/nsHTMLDocument.cpp
@@ -174,18 +174,17 @@ nsHTMLDocument::nsHTMLDocument()
       mLoadFlags(0),
       mTooDeepWriteRecursion(false),
       mDisableDocWrite(false),
       mWarnedWidthHeight(false),
       mContentEditableCount(0),
       mEditingState(EditingState::eOff),
       mDisableCookieAccess(false),
       mPendingMaybeEditingStateChanged(false),
-      mHasBeenEditable(false),
-      mIsPlainText(false) {
+      mHasBeenEditable(false) {
   mType = eHTML;
   mDefaultElementType = kNameSpaceID_XHTML;
   mCompatMode = eCompatibility_NavQuirks;
 }
 
 nsHTMLDocument::~nsHTMLDocument() {}
 
 NS_IMPL_CYCLE_COLLECTION_INHERITED(nsHTMLDocument, Document, mAll,
@@ -470,25 +469,25 @@ nsresult nsHTMLDocument::StartDocumentLo
   if (!(view || viewSource || asData)) {
     MOZ_ASSERT(false, "Bad parser command");
     return NS_ERROR_INVALID_ARG;
   }
 
   bool html = contentType.EqualsLiteral(TEXT_HTML);
   bool xhtml = !html && (contentType.EqualsLiteral(APPLICATION_XHTML_XML) ||
                          contentType.EqualsLiteral(APPLICATION_WAPXHTML_XML));
-  mIsPlainText =
+  bool plainText =
       !html && !xhtml && nsContentUtils::IsPlainTextType(contentType);
-  if (!(html || xhtml || mIsPlainText || viewSource)) {
+  if (!(html || xhtml || plainText || viewSource)) {
     MOZ_ASSERT(false, "Channel with bad content type.");
     return NS_ERROR_INVALID_ARG;
   }
 
   bool forceUtf8 =
-      mIsPlainText && nsContentUtils::IsUtf8OnlyPlainTextType(contentType);
+      plainText && nsContentUtils::IsUtf8OnlyPlainTextType(contentType);
 
   bool loadAsHtml5 = true;
 
   if (!viewSource && xhtml) {
     // We're parsing XHTML as XML, remember that.
     mType = eXHTML;
     mCompatMode = eCompatibility_FullStandards;
     loadAsHtml5 = false;
@@ -525,17 +524,17 @@ nsresult nsHTMLDocument::StartDocumentLo
   if (NS_FAILED(rv)) {
     return rv;
   }
 
   nsCOMPtr<nsICachingChannel> cachingChan = do_QueryInterface(aChannel);
 
   if (loadAsHtml5) {
     mParser = nsHtml5Module::NewHtml5Parser();
-    if (mIsPlainText) {
+    if (plainText) {
       if (viewSource) {
         mParser->MarkAsNotScriptCreated("view-source-plain");
       } else {
         mParser->MarkAsNotScriptCreated("plain-text");
       }
     } else if (viewSource && !html) {
       mParser->MarkAsNotScriptCreated("view-source-xml");
     } else {
@@ -671,17 +670,17 @@ nsresult nsHTMLDocument::StartDocumentLo
       // about:blank *only*
       nsCOMPtr<nsIHTMLContentSink> htmlsink;
       NS_NewHTMLContentSink(getter_AddRefs(htmlsink), this, uri, docShell,
                             aChannel);
       mParser->SetContentSink(htmlsink);
     }
   }
 
-  if (mIsPlainText && !nsContentUtils::IsChildOfSameType(this) &&
+  if (plainText && !nsContentUtils::IsChildOfSameType(this) &&
       Preferences::GetBool("plain_text.wrap_long_lines")) {
     nsCOMPtr<nsIStringBundleService> bundleService =
         do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv);
     NS_ASSERTION(NS_SUCCEEDED(rv) && bundleService,
                  "The bundle service could not be loaded");
     nsCOMPtr<nsIStringBundle> bundle;
     rv = bundleService->CreateBundle(
         "chrome://global/locale/browser.properties", getter_AddRefs(bundle));
@@ -751,26 +750,16 @@ void nsHTMLDocument::SetCompatibilityMod
   }
   mCompatMode = aMode;
   CSSLoader()->SetCompatibilityMode(mCompatMode);
   if (nsPresContext* pc = GetPresContext()) {
     pc->CompatibilityModeChanged();
   }
 }
 
-bool nsHTMLDocument::UseWidthDeviceWidthFallbackViewport() const {
-  if (mIsPlainText) {
-    // Plain text documents are simple enough that font inflation doesn't offer
-    // any appreciable advantage over defaulting to "width=device-width" and
-    // subsequently turning on word-wrapping.
-    return true;
-  }
-  return Document::UseWidthDeviceWidthFallbackViewport();
-}
-
 Element* nsHTMLDocument::GetUnfocusedKeyEventTarget() {
   if (nsGenericHTMLElement* body = GetBody()) {
     return body;
   }
   return Document::GetUnfocusedKeyEventTarget();
 }
 
 already_AddRefed<nsIURI> nsHTMLDocument::GetDomainURI() {
--- a/dom/html/nsHTMLDocument.h
+++ b/dom/html/nsHTMLDocument.h
@@ -63,20 +63,16 @@ class nsHTMLDocument : public mozilla::d
                                      nsISupports* aContainer,
                                      nsIStreamListener** aDocListener,
                                      bool aReset = true,
                                      nsIContentSink* aSink = nullptr) override;
 
   virtual void BeginLoad() override;
   virtual void EndLoad() override;
 
- protected:
-  virtual bool UseWidthDeviceWidthFallbackViewport() const override;
-
- public:
   // nsIHTMLDocument
   virtual void SetCompatibilityMode(nsCompatibility aMode) override;
 
   virtual bool IsWriting() override { return mWriteLevel != uint32_t(0); }
 
   virtual Element* GetUnfocusedKeyEventTarget() override;
 
   nsContentList* GetExistingForms() const { return mForms; }
@@ -337,21 +333,16 @@ class nsHTMLDocument : public mozilla::d
    * Temporary flag that is set in EndUpdate() to ignore
    * MaybeEditingStateChanged() script runners from a nested scope.
    */
   bool mPendingMaybeEditingStateChanged;
 
   // mHasBeenEditable is set to true when mEditingState is firstly set to
   // eDesignMode or eContentEditable.
   bool mHasBeenEditable;
-
-  /**
-   * Set to true once we know that we are loading plain text content.
-   */
-  bool mIsPlainText;
 };
 
 namespace mozilla {
 namespace dom {
 
 inline nsHTMLDocument* Document::AsHTMLDocument() {
   MOZ_ASSERT(IsHTMLOrXHTML());
   return static_cast<nsHTMLDocument*>(this);
--- a/mobile/android/app/mobile.js
+++ b/mobile/android/app/mobile.js
@@ -375,19 +375,16 @@ pref("devtools.remote.wifi.enabled", fal
 pref("font.size.inflation.minTwips", 0);
 
 // When true, zooming will be enabled on all sites, even ones that declare user-scalable=no.
 pref("browser.ui.zoom.force-user-scalable", false);
 
 // With the typical screen sizes on mobile devices, we want to wrap page sources by default.
 pref("view_source.wrap_long_lines", true);
 
-// Ditto for plain text documents.
-pref("plain_text.wrap_long_lines", true);
-
 
 pref("ui.touch.radius.enabled", false);
 pref("ui.touch.radius.leftmm", 3);
 pref("ui.touch.radius.topmm", 5);
 pref("ui.touch.radius.rightmm", 3);
 pref("ui.touch.radius.bottommm", 2);
 pref("ui.touch.radius.visitedWeight", 120);