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

Side by Side Diff: third_party/WebKit/Source/core/layout/ng/inline/ng_inline_item.cc

Issue 2865903002: [LayoutNG] Inline margin/border/padding, inter-item breaking, and tests (Closed)
Patch Set: TestExpectations Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/layout/ng/inline/ng_inline_item.h" 5 #include "core/layout/ng/inline/ng_inline_item.h"
6 6
7 #include "core/layout/LayoutInline.h"
7 #include "core/layout/LayoutObject.h" 8 #include "core/layout/LayoutObject.h"
8 #include "platform/fonts/CharacterRange.h" 9 #include "platform/fonts/CharacterRange.h"
9 #include "platform/fonts/shaping/ShapeResultBuffer.h" 10 #include "platform/fonts/shaping/ShapeResultBuffer.h"
10 11
11 namespace blink { 12 namespace blink {
12 namespace { 13 namespace {
13 14
14 const char* kNGInlineItemTypeStrings[] = { 15 const char* kNGInlineItemTypeStrings[] = {
15 "Text", "Control", "AtomicInline", "OpenTag", 16 "Text", "Control", "AtomicInline", "OpenTag",
16 "CloseTag", "Floating", "OutOfFlowPositioned", "BidiControl"}; 17 "CloseTag", "Floating", "OutOfFlowPositioned", "BidiControl"};
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 unsigned start, 117 unsigned start,
117 unsigned end) const { 118 unsigned end) const {
118 DCHECK_GE(start, StartOffset()); 119 DCHECK_GE(start, StartOffset());
119 DCHECK_LE(start, end); 120 DCHECK_LE(start, end);
120 DCHECK_LE(end, EndOffset()); 121 DCHECK_LE(end, EndOffset());
121 122
122 // TODO(kojii): Implement |start| and |end|. 123 // TODO(kojii): Implement |start| and |end|.
123 shape_result_->FallbackFonts(fallback_fonts); 124 shape_result_->FallbackFonts(fallback_fonts);
124 } 125 }
125 126
127 bool NGInlineItem::HasStartEdge() const {
128 DCHECK(Type() == kOpenTag || Type() == kCloseTag);
129 return !GetLayoutObject()->IsInlineElementContinuation();
ikilpatrick 2017/05/30 16:05:26 These should be switch to break token checks at so
kojii 2017/05/30 17:56:18 Done.
130 }
131
132 bool NGInlineItem::HasEndEdge() const {
133 DCHECK(Type() == kOpenTag || Type() == kCloseTag);
134 return !ToLayoutInline(GetLayoutObject())->Continuation();
135 }
136
126 NGInlineItemRange::NGInlineItemRange(Vector<NGInlineItem>* items, 137 NGInlineItemRange::NGInlineItemRange(Vector<NGInlineItem>* items,
127 unsigned start_index, 138 unsigned start_index,
128 unsigned end_index) 139 unsigned end_index)
129 : start_item_(&(*items)[start_index]), 140 : start_item_(&(*items)[start_index]),
130 size_(end_index - start_index), 141 size_(end_index - start_index),
131 start_index_(start_index) { 142 start_index_(start_index) {
132 CHECK_LE(start_index, end_index); 143 CHECK_LE(start_index, end_index);
133 CHECK_LE(end_index, items->size()); 144 CHECK_LE(end_index, items->size());
134 } 145 }
135 146
136 } // namespace blink 147 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698