Changeset 246475 in webkit
- Timestamp:
- Jun 16, 2019, 12:28:14 PM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
-
ChangeLog (modified) (1 diff)
-
layout/displaytree/DisplayBox.h (modified) (1 diff)
-
layout/inlineformatting/InlineLine.cpp (modified) (6 diffs)
-
layout/inlineformatting/InlineLine.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r246471 r246475 1 2019-06-16 Zalan Bujtas <zalan@apple.com> 2 3 [LFC][IFC] Use the borderBox rect consistently to size the inline box. 4 https://bugs.webkit.org/show_bug.cgi?id=198899 5 6 Reviewed by Antti Koivisto. 7 <rdar://problem/51781969> 8 9 Use the margin box height (when applicable) to adjust the line height and use the borderBox rect (or font size) height to size the inline box. 10 11 * layout/displaytree/DisplayBox.h: 12 (WebCore::Display::Box::borderBoxHeight const): 13 (WebCore::Display::Box::marginBoxHeight const): 14 * layout/inlineformatting/InlineLine.cpp: 15 (WebCore::Layout::Line::appendInlineContainerStart): 16 (WebCore::Layout::Line::appendTextContent): 17 (WebCore::Layout::Line::appendNonReplacedInlineBox): 18 (WebCore::Layout::Line::inlineItemContentHeight const): 19 (WebCore::Layout::Line::inlineItemHeight const): Deleted. 20 * layout/inlineformatting/InlineLine.h: 21 1 22 2019-06-15 Simon Fraser <simon.fraser@apple.com> 2 23 -
trunk/Source/WebCore/layout/displaytree/DisplayBox.h
r245776 r246475 120 120 LayoutUnit paddingBoxWidth() const { return paddingLeft().valueOr(0) + contentBoxWidth() + paddingRight().valueOr(0); } 121 121 122 LayoutUnit borderBoxHeight() const { return borderTop() + paddingBoxHeight() + borderBottom(); } 122 123 LayoutUnit borderBoxWidth() const { return borderLeft() + paddingBoxWidth() + borderRight(); } 124 LayoutUnit marginBoxHeight() const { return marginBefore() + borderBoxHeight() + marginAfter(); } 123 125 LayoutUnit marginBoxWidth() const { return marginStart() + borderBoxWidth() + marginEnd(); } 124 126 -
trunk/Source/WebCore/layout/inlineformatting/InlineLine.cpp
r246457 r246475 178 178 179 179 if (!m_skipVerticalAligment) { 180 auto logicalHeight = inlineItem Height(inlineItem);180 auto logicalHeight = inlineItemContentHeight(inlineItem); 181 181 adjustBaselineAndLineHeight(inlineItem, logicalHeight); 182 182 logicalRect.setHeight(logicalHeight); … … 225 225 logicalRect.setWidth(logicalWidth); 226 226 if (!m_skipVerticalAligment) 227 logicalRect.setHeight(inlineItem Height(inlineItem));227 logicalRect.setHeight(inlineItemContentHeight(inlineItem)); 228 228 229 229 auto textContext = Content::Run::TextContext { inlineItem.start(), inlineItem.isCollapsed() ? 1 : inlineItem.length() }; … … 245 245 logicalRect.setWidth(logicalWidth); 246 246 if (!m_skipVerticalAligment) { 247 auto logicalHeight = inlineItemHeight(inlineItem); 248 adjustBaselineAndLineHeight(inlineItem, logicalHeight); 249 logicalRect.setHeight(logicalHeight); 247 adjustBaselineAndLineHeight(inlineItem, displayBox.marginBoxHeight()); 248 logicalRect.setHeight(inlineItemContentHeight(inlineItem)); 250 249 } 251 250 … … 321 320 } 322 321 323 LayoutUnit Line::inlineItem Height(const InlineItem& inlineItem) const322 LayoutUnit Line::inlineItemContentHeight(const InlineItem& inlineItem) const 324 323 { 325 324 ASSERT(!m_skipVerticalAligment); … … 333 332 334 333 if (layoutBox.isFloatingPositioned()) 335 return displayBox. marginBox().height();334 return displayBox.borderBoxHeight(); 336 335 337 336 if (layoutBox.isReplaced()) 338 return displayBox. height();337 return displayBox.borderBoxHeight(); 339 338 340 339 if (inlineItem.isContainerStart() || inlineItem.isContainerEnd()) … … 342 341 343 342 // Non-replaced inline box (e.g. inline-block) 344 return displayBox. marginBox().height();343 return displayBox.borderBoxHeight(); 345 344 } 346 345 -
trunk/Source/WebCore/layout/inlineformatting/InlineLine.h
r246457 r246475 123 123 124 124 void adjustBaselineAndLineHeight(const InlineItem&, LayoutUnit runHeight); 125 LayoutUnit inlineItem Height(const InlineItem&) const;125 LayoutUnit inlineItemContentHeight(const InlineItem&) const; 126 126 bool isVisuallyEmpty() const; 127 127
Note:
See TracChangeset
for help on using the changeset viewer.