From 2fea437c601cce8ab25715c2c6a6a57748582031 Mon Sep 17 00:00:00 2001 From: Jaro Date: Wed, 28 Jun 2023 00:50:38 +0200 Subject: [PATCH] Clarify that fragmentContentRect is unstandardised. --- CHANGELOG.md | 4 ++-- src/Data/Text/ParagraphLayout/Internal/Fragment.hs | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5333c49..8f6ae56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,8 +11,8 @@ * Added option to prevent making boxes invisible when they contain no glyphs and no forced (hard) line breaks. -* Added `fragmentContentRect` to represent parts of the CSS content box - for inline elements. +* Added `fragmentContentRect` to provide a popular (though unstandardised) + way of determining the content area of inline elements. * Added function `paragraphSafeWidth` to help calculating max-content width for CSS. diff --git a/src/Data/Text/ParagraphLayout/Internal/Fragment.hs b/src/Data/Text/ParagraphLayout/Internal/Fragment.hs index 5467f84..72995ab 100644 --- a/src/Data/Text/ParagraphLayout/Internal/Fragment.hs +++ b/src/Data/Text/ParagraphLayout/Internal/Fragment.hs @@ -42,8 +42,9 @@ data Fragment d = Fragment -- using all glyph advances in this fragment and the used font's ascent -- and descent metrics. -- - -- This can be used to determine the /content box/ of an inline element - -- as understood in CSS. + -- This is commonly used as the /content area/ of inline elements in + -- web browsers, although this behaviour is not specified in CSS 2 + -- nor in CSS Inline Layout Module Level 3. , fragmentRect :: Rect Int32 -- ^ Physical position of the fragment within the paragraph, calculated -- 2.30.2