diff --git a/mk/doc.mk b/mk/doc.mk
index 20648070e0d..2ea06e65637 100644
--- a/mk/doc.mk
+++ b/mk/doc.mk
@@ -2,8 +2,13 @@
# 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/.
+
+RUSTDOC_HTML_IN_HEADER = $(S)/src/etc/rustdoc-style.html
+RUSTDOC_FLAGS = --html-in-header $(RUSTDOC_HTML_IN_HEADER)
+RUSTDOC_DEPS = $(RUSTDOC_HTML_IN_HEADER)
+
# FIXME(#2924) These crates make rustdoc fail for undetermined reasons.
-DOC_BLACKLISTED := style layout
+DOC_BLACKLISTED := style
define DEF_DOC_RULES
.PHONY: doc-$(1)
@@ -11,14 +16,14 @@ doc-$(1): doc/$(1)/index.html
ifeq (,$(filter $(1),$(DOC_BLACKLISTED)))
-doc/$(1)/index.html: $$(DEPS_$(1))
+doc/$(1)/index.html: $$(DEPS_$(1)) $$(RUSTDOC_DEPS)
@$$(call E, rustdoc: $$@)
- $$(Q)$$(RUSTDOC) $$(RFLAGS_$(1)) $$<
+ $$(Q)$$(RUSTDOC) $$(RUSTDOC_FLAGS) $$(RFLAGS_$(1)) $$<
else
.PHONY: doc/$(1)/index.html
-doc/$(1)/index.html: $$(DEPS_$(1))
+doc/$(1)/index.html:
@echo SKIPPED: blacklisted rustdoc: $$@
endif
diff --git a/src/components/layout/inline.rs b/src/components/layout/inline.rs
index cd279d172cd..94b2d46b8e8 100644
--- a/src/components/layout/inline.rs
+++ b/src/components/layout/inline.rs
@@ -71,7 +71,7 @@ pub struct Line {
/// I like truffles,
yes I do.
/// ~~~
///
- /// ~~~
+ /// ~~~text
/// +------------+
/// | I like |
/// | truffles, |
@@ -84,11 +84,9 @@ pub struct Line {
///
/// The ranges that describe these lines would be:
///
- /// ~~~
/// | [0.0, 1.4) | [1.5, 2.0) | [2.0, 3.4) | [3.4, 4.0) |
/// |------------|-------------|-------------|------------|
/// | 'I like' | 'truffles,' | '
yes' | 'I do.' |
- /// ~~~
pub range: Range,
/// The bounds are the exact position and extents of the line with respect
/// to the parent box.
@@ -101,7 +99,7 @@ pub struct Line {
///
/// ...the bounds would be:
///
- /// ~~~
+ /// ~~~text
/// +-----------------------------------------------------------+
/// | ^ |
/// | | |
@@ -123,7 +121,7 @@ pub struct Line {
/// The green zone is the greatest extent from wich a line can extend to
/// before it collides with a float.
///
- /// ~~~
+ /// ~~~text
/// +-----------------------+
/// |::::::::::::::::: |
/// |:::::::::::::::::FFFFFF|
@@ -164,11 +162,9 @@ pub struct LineIndices {
///
/// The fragments would be indexed as follows:
///
- /// ~~~
- /// | 0 | 1 | 2 | 3 |
- /// |------|------------------|-------|--------------|
- /// | 'I ' | 'like truffles,' |
| ' yes I do.' |
- /// ~~~
+ /// | 0 | 1 | 2 | 3 |
+ /// |------|------------------|---------|--------------|
+ /// | 'I ' | 'like truffles,' | `
` | ' yes I do.' |
pub fragment_index: FragmentIndex,
/// The index of a character in a DOM fragment. Continuous runs of whitespace
/// are treated as single characters. Non-breakable DOM fragments such as
@@ -182,15 +178,13 @@ pub struct LineIndices {
///
/// The characters would be indexed as follows:
///
- /// ~~~
/// | 0 | 1 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
/// |---|---|---|---|---|---|---|---|---|---|---|---|----|----|----|----|----|
/// | I | | l | i | k | e | | t | r | u | f | f | l | e | s | , | |
///
- /// | 0 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
- /// |-------|---|---|---|---|---|---|---|---|---|---|
- /// |
| | y | e | s | | I | | d | o | . |
- /// ~~~
+ /// | 0 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
+ /// |---------|---|---|---|---|---|---|---|---|---|---|
+ /// | `
` | | y | e | s | | I | | d | o | . |
pub char_index: CharIndex,
}
diff --git a/src/etc/rustdoc-style.html b/src/etc/rustdoc-style.html
new file mode 100644
index 00000000000..bd4d0cc11cd
--- /dev/null
+++ b/src/etc/rustdoc-style.html
@@ -0,0 +1,8 @@
+