diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp
index 0601da08e94f..e0622aa74844 100644
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -10493,9 +10493,6 @@ nsDocShell::InternalLoad(nsIURI* aURI,
(aFlags & INTERNAL_LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP) != 0;
mURIResultedInDocument = false; // reset the clock...
- // Note that there is code that relies on this check to stop us entering the
- // `doShortCircuitedLoad` block below for certain load types. (For example,
- // reftest-content.js uses LOAD_FLAGS_BYPASS_CACHE for this purpose.)
if (aLoadType == LOAD_NORMAL ||
aLoadType == LOAD_STOP_CONTENT ||
LOAD_TYPE_HAS_FLAGS(aLoadType, LOAD_FLAGS_REPLACE_HISTORY) ||
diff --git a/layout/reftests/bugs/reftest.list b/layout/reftests/bugs/reftest.list
index 66b1bab11722..28bc9ddf2ab3 100644
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -305,7 +305,7 @@ fuzzy-if(Android,3,50) fuzzy-if(skiaContent,1,133) == 273681-1.html 273681-1-ref
== 283686-2.html 283686-2-ref.html
== 283686-3.html about:blank
== 289384-1.xhtml 289384-ref.xhtml
-random-if(d2d) fuzzy-if(Android,8,1439) HTTP == 289480.html#top 289480-ref.html # basically-verbatim acid2 test, HTTP for a 404 page -- bug 578114 for the d2d failures
+random-if(d2d) fuzzy-if(Android,8,1439) skip-if(styloVsGecko) HTTP == 289480.html#top 289480-ref.html # basically-verbatim acid2 test, HTTP for a 404 page -- bug 578114 for the d2d failures, bug 1354406
== 290129-1.html 290129-1-ref.html
== 291078-1.html 291078-1-ref.html
== 291078-2.html 291078-2-ref.html
@@ -1473,7 +1473,7 @@ random == 536061.html 536061-ref.html # fixedpoint division in blur code makes t
== 539323-3.html 539323-3-ref.html
== 539880-1.html 539880-1-ref.html
== 539880-1-dynamic.html 539880-1-ref.html
-fuzzy-if(Android,12,1000) == 539949-1.html#test2 539949-1-ref.html#test2
+fuzzy-if(Android,12,1000) skip-if(styloVsGecko) == 539949-1.html#test2 539949-1-ref.html#test2 # bug 1354406
== 541382-1.html 541382-1-ref.html
random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)||!haveTestPlugin) HTTP == 541406-1.html 541406-1-ref.html
needs-focus != 542116-1.html 542116-1-ref.html
diff --git a/layout/reftests/css-ui/caret-color-01-ref.html b/layout/reftests/css-ui/caret-color-01-ref.html
index 2092e62c77d9..b516c9262430 100644
--- a/layout/reftests/css-ui/caret-color-01-ref.html
+++ b/layout/reftests/css-ui/caret-color-01-ref.html
@@ -1,19 +1,5 @@
-
-
-
+
-
+
diff --git a/layout/reftests/scrolling/reftest.list b/layout/reftests/scrolling/reftest.list
index b961563136fd..585b974fae65 100644
--- a/layout/reftests/scrolling/reftest.list
+++ b/layout/reftests/scrolling/reftest.list
@@ -1,4 +1,4 @@
-HTTP == deferred-anchor.xhtml#d deferred-anchor-ref.xhtml#d
+skip-if(styloVsGecko) HTTP == deferred-anchor.xhtml#d deferred-anchor-ref.xhtml#d # bug 1354406
fuzzy-if(xulRuntime.widgetToolkit=="gtk3",1,23) == deferred-anchor2.xhtml deferred-anchor-ref.xhtml#d # bug 1182632
HTTP == fixed-1.html fixed-1.html?ref
fuzzy-if(skiaContent,1,32200) HTTP == fixed-table-1.html fixed-table-1.html?ref
@@ -22,7 +22,7 @@ pref(layout.css.scroll-behavior.enabled,true) pref(layout.css.scroll-behavior.pr
pref(layout.css.scroll-behavior.enabled,true) pref(layout.css.scroll-behavior.property-enabled,true) == scroll-behavior-10.html scroll-behavior-10.html?ref
pref(layout.css.scroll-behavior.enabled,true) pref(layout.css.scroll-behavior.property-enabled,true) == scroll-behavior-textarea.html scroll-behavior-textarea.html?ref
HTTP == simple-1.html simple-1.html?ref
-HTTP == subpixel-1.html#d subpixel-1-ref.html#d
+skip-if(styloVsGecko) HTTP == subpixel-1.html#d subpixel-1-ref.html#d # bug 1354406
fuzzy-if(Android,4,120) HTTP == text-1.html text-1.html?ref
fuzzy-if(Android,4,120) HTTP == text-2.html?up text-2.html?ref
fuzzy-if(d2d,1,4) fuzzy-if(webrender,0-1,0-42) HTTP == transformed-1.html transformed-1.html?ref
diff --git a/layout/reftests/svg/smil/reftest.list b/layout/reftests/svg/smil/reftest.list
index 34452bf2f095..8a32bbc2abee 100644
--- a/layout/reftests/svg/smil/reftest.list
+++ b/layout/reftests/svg/smil/reftest.list
@@ -142,7 +142,7 @@ random-if(webrender) == anim-marker-orient-02.svg lime.svg
fuzzy-if(Android,4,1) == anim-svg-viewBox-01.svg lime.svg
== anim-svg-viewBox-02.svg lime.svg
== anim-svg-viewBox-03.svg lime.svg
-== anim-view-01.svg#view lime.svg
+skip-if(styloVsGecko) == anim-view-01.svg#view lime.svg # bug 1354406
# animate some preserveAspectRatio attributes
== anim-feImage-preserveAspectRatio-01.svg lime.svg
diff --git a/layout/tools/reftest/reftest-content.js b/layout/tools/reftest/reftest-content.js
index 147c0d28b6de..b357629d6b51 100644
--- a/layout/tools/reftest/reftest-content.js
+++ b/layout/tools/reftest/reftest-content.js
@@ -1055,38 +1055,9 @@ function DoAssertionCheck()
SendAssertionCount(numAsserts);
}
-function URIsEqualIgnoringHash(uri1, uri2)
-{
- if (!uri2) {
- return false;
- }
- let hashIndex1 = uri1.indexOf("#");
- if (hashIndex1 > -1) {
- uri1 = uri1.substr(0, hashIndex1);
- }
- let hashIndex2 = uri2.indexOf("#");
- if (hashIndex2 > -1) {
- uri2 = uri2.substr(0, hashIndex2);
- }
- return uri1 == uri2;
-}
-
function LoadURI(uri)
{
- let flags = CI.nsIWebNavigation.LOAD_FLAGS_NONE;
-
- if (URIsEqualIgnoringHash(uri, gCurrentURL)) {
- // In this case the new URI would normally just cause an anchor scroll
- // so we use LOAD_FLAGS_BYPASS_CACHE to force a reload so we'll get a
- // 'load' event. (The code that handles new URIs once they're ready is
- // triggered by a 'load' event, so we'll time out if we don't get one).
- //
- // Note that we avoid using this flag in general since we don't want
- // to unnecessarily reload and reprocess common font files, images,
- // etc. for every test/reference (that may slow down reftest runs).
- flags = CI.nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE;
- }
-
+ var flags = webNavigation().LOAD_FLAGS_NONE;
webNavigation().loadURI(uri, flags, null, null, null);
}