aboutsummaryrefslogtreecommitdiff
path: root/brep
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-02-02 17:29:39 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-02-02 17:39:09 +0200
commit049d57e59279cc84d0dd23c8c8ff919edde8f14b (patch)
tree0f47bf3b7cf5862abac1cfe540234ec86321bb83 /brep
parent0222b0696f4b160105d0d5bc953e640cdcd54219 (diff)
Fix FOUC effect in Firefox caused by autofocus
Diffstat (limited to 'brep')
-rw-r--r--brep/mod-package-details.cxx9
-rw-r--r--brep/mod-package-search.cxx9
2 files changed, 18 insertions, 0 deletions
diff --git a/brep/mod-package-details.cxx b/brep/mod-package-details.cxx
index 2c7c04d..f2f8bd6 100644
--- a/brep/mod-package-details.cxx
+++ b/brep/mod-package-details.cxx
@@ -119,6 +119,15 @@ handle (request& rq, response& rs)
s << ~TITLE
<< CSS_LINKS (path ("package-details.css"), root)
+ //
+ // This hack is required to avoid the "flash of unstyled content", which
+ // happens due to the presence of the autofocus attribute in the input
+ // element of the search form. The problem appears in Firefox and has a
+ // (4-year old, at the time of this writing) bug report:
+ //
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=712130.
+ //
+ << SCRIPT << " " << ~SCRIPT
<< ~HEAD
<< BODY
<< DIV_HEADER (root)
diff --git a/brep/mod-package-search.cxx b/brep/mod-package-search.cxx
index d649ff4..b283a5b 100644
--- a/brep/mod-package-search.cxx
+++ b/brep/mod-package-search.cxx
@@ -112,6 +112,15 @@ handle (request& rq, response& rs)
s << ~TITLE
<< CSS_LINKS (path ("package-search.css"), root)
+ //
+ // This hack is required to avoid the "flash of unstyled content", which
+ // happens due to the presence of the autofocus attribute in the input
+ // element of the search form. The problem appears in Firefox and has a
+ // (4-year old, at the time of this writing) bug report:
+ //
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=712130.
+ //
+ << SCRIPT << " " << ~SCRIPT
<< ~HEAD
<< BODY
<< DIV_HEADER (root)