Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(499)

Unified Diff: third_party/WebKit/Source/core/layout/line/InlineBox.h

Issue 2643413002: Fix 'text-underline-position: under' to use em height ascent/descent (Closed)
Patch Set: eae review Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/line/InlineBox.h
diff --git a/third_party/WebKit/Source/core/layout/line/InlineBox.h b/third_party/WebKit/Source/core/layout/line/InlineBox.h
index bd77dee07414a993e7b32950273ce0f408755675..105bf7ad92e203b91c132e8ac30bc9041cd081fb 100644
--- a/third_party/WebKit/Source/core/layout/line/InlineBox.h
+++ b/third_party/WebKit/Source/core/layout/line/InlineBox.h
@@ -39,6 +39,27 @@ class RootInlineBox;
enum MarkLineBoxes { kMarkLineBoxesDirty, kDontMarkLineBoxes };
+enum class LineVerticalPositionType {
+ // TextTop and TextBottom are the top/bottom of the content area.
+ // This is where 'vertical-align: text-top/text-bottom' aligns to.
+ // This is explicitly undefined in CSS2.
+ // https://drafts.csswg.org/css2/visudet.html#inline-non-replaced
+ TextTop,
+ TextBottom,
+ // Em height as being discussed in Font Metrics API.
+ // https://drafts.css-houdini.org/font-metrics-api-1/#fontmetrics
+ TopOfEmHeight,
+ BottomOfEmHeight
+};
+
+// Returns whether the position type is CSS "line-over"; i.e., ascender side
+// or "top" side of a line box.
+// https://drafts.csswg.org/css-writing-modes-3/#line-over
+static inline bool IsLineOverSide(LineVerticalPositionType type) {
+ return type == LineVerticalPositionType::TextTop ||
+ type == LineVerticalPositionType::TopOfEmHeight;
+}
+
// InlineBox represents a rectangle that occurs on a line. It corresponds to
// some LayoutObject (i.e., it represents a portion of that LayoutObject).
class CORE_EXPORT InlineBox : public DisplayItemClient {

Powered by Google App Engine
This is Rietveld 408576698