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

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: Rebaseline 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..401a8567329705c704fc99c81210a5897aca730f 100644
--- a/third_party/WebKit/Source/core/layout/line/InlineBox.h
+++ b/third_party/WebKit/Source/core/layout/line/InlineBox.h
@@ -39,6 +39,24 @@ 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
+};
+
+static inline bool IsOverSide(LineVerticalPositionType type) {
eae 2017/05/01 16:21:48 Above might be a better term than Over as over cou
kojii 2017/05/02 22:56:52 Ah, didn't know "over" could mean that. I meant th
+ 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