Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/odr/internal/html/document_style.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,7 @@ std::string html::translate_frame_properties(const Frame &frame) {
horizontal_position = *style.horizontal_position;
}

// The frame says it positions itself: read without the stylesheet's
// `*{position:relative}`, its image would fill the viewport instead.
// The frame is what its image sizes against.
std::string result;
if (const AnchorType anchor_type = frame.anchor_type();
anchor_type == AnchorType::as_char) {
Expand Down
6 changes: 4 additions & 2 deletions src/odr/internal/html/frontend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ namespace {
/// Every page we write states its own body margin and background, rather than
/// reading whatever the browser's default sheet says.
constexpr std::string_view document_css = R"css(
*{margin:0;position:relative}
body{margin:0;background:#fff}
/* What the formats anchor against: a page for shapes, a paragraph or a cell
for frames. */
x-p,td,.odr-page-outer{position:relative}
x-p{display:block;font-size:0}
x-s{display:inline}
.odr-background{padding:0;background:#525659}
Expand Down Expand Up @@ -75,7 +77,7 @@ td x-p{height:inherit}
.odr-sheet tbody tr.odr-sheet-pinned>*{background-image:linear-gradient(var(--odr-sheet-wash-pinned),var(--odr-sheet-wash-pinned))}
.odr-sheet tbody tr:hover>th,.odr-sheet tbody tr.odr-sheet-pinned>th{background-image:linear-gradient(var(--odr-sheet-wash-ruler),var(--odr-sheet-wash-ruler))}
.odr-sheet .odr-sheet-pinned-cell{outline:2px solid var(--odr-sheet-focus);outline-offset:-2px}
/* `*{position:relative}` already makes the header a containing block. */
/* The header's `position:sticky` already makes it a containing block. */
.odr-sheet-sort{position:absolute;top:1px;right:1px;bottom:1px;width:17px;display:flex;align-items:center;justify-content:center;border-radius:2px;opacity:0;cursor:pointer}
.odr-sheet-column-header:hover .odr-sheet-sort,.odr-sheet-sort-asc,.odr-sheet-sort-desc{opacity:1}
.odr-sheet-sort:hover{background:var(--odr-sheet-wash-ruler)}
Expand Down
Loading